diff --git a/build/vessel.js b/build/vessel.js index 42fda36..146fc89 100644 --- a/build/vessel.js +++ b/build/vessel.js @@ -1,95 +1,153 @@ -const REVISION = "v0.14-alpha"; +//vessel.js library, built 2023-08-05 18:10:42.035919 +/* +Import like this in HTML: + +Then in javascript use classes and functions with a vessel prefix. Example: +let ship = new vessel.Ship(someSpecification); +*/ + +"use strict"; +var vessel = {}; +var Vessel = vessel; //alias for backwards compatibility + +(function() { //@EliasHasle -/*Base class for objects that are constructed from -a literal object. +//Some small helpers for operations on 3D vectors +//A vector is simply defined as an object with properties x,y,z. -Constructors can take more parameters than the specification, but the specification must be the first parameter. +var Vectors = { + clone: function ( v ) { -setFromSpecification will typically be overridden by derived classes. Overriding implementations will typically do some sanity checking. + return { x: v.x, y: v.y, z: v.z }; -getSpecification will also typically be overridden. The default implementation here is just a sketch. Maybe not even correct for the simplest subclasses. + }, -Maybe this can be improved by implementing fromJSON and to toJSON methods. -*/ + scale: function ( v, s ) { + + return { x: s * v.x, y: s * v.y, z: s * v.z }; -class JSONSpecObject { + }, - constructor( specification, baseObjects ) { + norm: function ( v ) { - if ( specification === null ) { + return Math.sqrt( v.x ** 2 + v.y ** 2 + v.z ** 2 ); - console.warn( "JSONSpecObject: null specification provided. Defaulting to empty specification." ); - specification = {}; + }, - } else if ( typeof specification === "object" ) ; else { + normalize: function ( v ) { - /*else if (typeof specification === "string") { - try { - specification = JSON.parse(specification); - } catch(e) { - console.error("JSONSpecObject: "+ e.message + "\n Defaulting to empty specification."); - specification = {}; - } - }*/ - if ( typeof specification !== "undefined" ) { + let l = norm( v ); + return { x: v.x / l, y: v.y / l, z: v.z / l }; - console.error( "JSONSpecObject: Invalid constructor parameter. Defaulting to empty specification." ); + }, - } + normSquared: function ( v ) { - specification = {}; + return v.x ** 2 + v.y ** 2 + v.z ** 2; - } + }, - if ( baseObjects ) { + /*Adds two or more vectors given as individual parameters, + and returns a new vector that is the component-wise + sum of the input vectors.*/ + add: function ( u, v, ...rest ) { + + if ( rest.length > 0 ) return Vectors.sum( [ u, v ] + rest ); + return { x: u.x + v.x, y: u.y + v.y, z: u.z + v.z }; + + }, + + //Takes an array of vectors as input, and returns a new vector + //that is the component-wise sum of the input vectors. + sum: function ( vectors ) { + + let S = { x: 0, y: 0, z: 0 }; + for ( let i = 0; i < vectors.length; i ++ ) { - this.baseObjects = baseObjects; + let v = vectors[ i ]; + S.x += v.x; + S.y += v.y; + S.z += v.z; } - this.setFromSpecification( specification ); + return S; - } + }, + + //Takes two vector parameters u,v, and returns the vector u-v. + sub: function ( u, v ) { - setFromSpecification( specification ) { + //return Vectors.add(u, Vectors.scale(v, -1)); //equivalent + return { x: u.x - v.x, y: u.y - v.y, z: u.z - v.z }; - //No sanity checking by default. - Object.assign( this, specification ); - return this; + }, - } + dot: function ( u, v ) { - getSpecification() { + return u.x * v.x + u.y * v.y + u.z * v.z; - let spec = {}; - for ( k of Object.keys( this ) ) { + }, - if ( this.hasOwnProperty( k ) ) spec[ k ] = this[ k ]; + cross: function ( u, v ) { - } + return { + x: u.y * v.z - u.z * v.y, + y: u.z * v.x - u.x * v.z, + z: u.x * v.y - u.y * v.x + }; - return spec; + }, - } + mulComponents: function ( u, v ) { - //toJSON is the standard way. Added here for testing. - toJSON() { + return { + x: u.x * v.x, + y: u.y * v.y, + z: u.z * v.z + }; - return this.getSpecification(); + }, - } + //Return the result of rotating the vector v by angles r={x,y,z} in radians. + //Intrinsic ZYX order (yaw,pitch,roll) is achieved by applying world axis rotations in XYZ order. + rotateTaitBryan: function ( v, r ) { - //fromJSON is added as an alternative and better name. - fromJSON( spec ) { + let c, s; + + //Rotate around x axis + c = Math.cos( r.x ); + s = Math.sin( r.x ); + v = { + x: v.x, + y: v.y * c - v.z * s, + z: v.y * s + v.z * c + }; - return this.setFromSpecification( spec ); + //Then around y axis + c = Math.cos( r.y ); + s = Math.sin( r.y ); + v = { + x: v.z * s + v.x * c, + y: v.y, + z: v.z * c - v.x * s + }; - } + //Then around z axis + c = Math.cos( r.z ); + s = Math.sin( r.z ); + v = { + x: v.x * c - v.y * s, + y: v.x * s + v.y * c, + z: v.z + }; -} + return v; + } +}; //@EliasHasle //Some interpolation helpers. Only linear and bilinear for now. @@ -151,6 +209,25 @@ function linearFromArrays( xx, yy, x ) { } +//Source: https://en.wikipedia.org/wiki/Bilinear_interpolation +//(I have used other sources too) +function bilinearUnitSquareCoeffs( z00, z01, z10, z11 ) { + + let a00 = z00; //mux=muy=0 + let a10 = z10 - z00; //mux=1, muy=0 + let a01 = z01 - z00; //mux=0, muy=1 + let a11 = z11 + z00 - z01 - z10; //mux=muy=1 + return [ a00, a10, a01, a11 ]; + +} + +function bilinearUnitSquare( z00, z01, z10, z11, mux, muy ) { + + let [ a00, a10, a01, a11 ] = bilinearUnitSquareCoeffs( z00, z01, z10, z11 ); + return a00 + a10 * mux + a01 * muy + a11 * mux * muy; + +} + //Find coefficients for 1, x, y, xy. //This doesn't yet handle zero-lengths well. function bilinearCoeffs( x1, x2, y1, y2, z00, z01, z10, z11 ) { @@ -199,1373 +276,750 @@ function bilinear( x1, x2, y1, y2, z11, z12, z21, z22, x, y ) { return fromCoeffs; } +//@EliasHasle -class BaseObject extends JSONSpecObject { - - constructor( specification ) { - - super( specification ); - this.weightCache = {}; +//All inputs are numbers. The axes are given by a single coordinate. +function steiner(I, A, sourceAxis, targetAxis) { + return I + A * (sourceAxis - targetAxis) ** 2; +} +//Calculate area, center, Ix, Iy. +function trapezoidCalculation(xbase0, xbase1, xtop0, xtop1, ybase, ytop) { + let a = xbase1 - xbase0; + let b = xtop1 - xtop0; + let h = ytop - ybase; + if (a < 0 || b < 0 || h < 0) { + console.warn("trapezoidCalculation: Unsupported input. Possibly not a valid trapezoid."); } + let A = 0.5 * (a + b) * h; + let yc = (a == 0 && b == 0) ? ybase + 0.5 * h : ybase + h * (2 * a + b) / (3 * (a + b)); + let d = xbase0 + 0.5 * a; //shorthand + let xc = h === 0 ? 0.25 * (xbase0 + xbase1 + xtop0 + xtop1) : d + (xtop0 + 0.5 * b - d) * (yc - ybase) / h; + let Ix = (a == 0 && b == 0) ? 0 : h ** 3 * (a ** 2 + 4 * a * b + b ** 2) / (36 * (a + b)); - setFromSpecification( spec ) { - - this.id = spec.id; - this.affiliations = spec.affiliations || {}; - this.boxDimensions = spec.boxDimensions || { length: undefined, width: undefined, height: undefined }; - this.weightInformation = spec.weightInformation; - this.cost = spec.cost || { currency: undefined, value: undefined }; - this.capabilities = spec.capabilities || {}; - this.file3D = spec.file3D; - this.baseState = spec.baseState; - return this; + //For Iy I must decompose (I think negative results will work fine): + let Art1 = 0.5 * (xtop0 - xbase0) * h; + let xcrt1 = xbase0 + (xtop0 - xbase0) / 3; + let Iyrt1 = (xtop0 - xbase0) ** 3 * h / 36; + let Arec = (xbase1 - xtop0) * h; + let xcrec = 0.5 * (xtop0 + xbase1); + let Iyrec = (xbase1 - xtop0) ** 3 * h / 12; + let Art2 = 0.5 * (xbase1 - xtop1) * h; + let xcrt2 = (xtop1 + (xbase1 - xtop1) / 3); + let Iyrt2 = (xbase1 - xtop1) ** 3 * h / 36; + + let Iy = steiner(Iyrt1, Art1, xcrt1, xc) + + steiner(Iyrec, Arec, xcrec, xc) + + steiner(Iyrt2, Art2, xcrt2, xc); + + let maxX = Math.max.apply(null, [xbase0, xbase1, xtop0, xtop1]); + let minX = Math.min.apply(null, [xbase0, xbase1, xtop0, xtop1]); + let maxY = Math.max(ybase, ytop); + let minY = Math.min(ybase, ytop); + + return {A: A, xc: xc, yc: yc, Ix: Ix, Iy: Iy, maxX: maxX, minX: minX, maxY: maxY, minY: minY}; +} +function combineAreas(array) { + let A = 0 + let xc = 0 + let yc = 0 + let maxX = 0, + minX = 0, + maxY = 0, + minY = 0 + let L = array.length + let foundMinY = false + let foundMaxY = false + for (let i = 0; i < L; i++) { + let e = array[i] + A += e.A + xc += e.xc * e.A + yc += e.yc * e.A + if (!isNaN(e.maxX) && e.maxX > maxX) maxX = e.maxX + if (!isNaN(e.minX) && e.minX < minX) minX = e.minX + if (!isNaN(e.maxY) && e.maxY > maxY && !foundMaxY && foundMinY) { + maxY = e.maxY + if (e.A === 0) { + foundMaxY = true + } + } + if (!isNaN(e.minY) && !foundMinY) { + if (e.A !== 0) { + minY = e.minY + foundMinY = true + } + } } + if (!foundMaxY) maxY = array[L-1].maxY //if foundMaxY is false then the ship is a barge and a different logic must apply @ferrari212 - getSpecification() { + let Ix = 0 + let Iy = 0 - return { - id: this.id, - affiliations: this.affiliations, - boxDimensions: this.boxDimensions, - weightInformation: this.weightInformation, - cost: this.cost, - capabilities: this.capabilities, - file3D: this.file3D, - baseState: this.baseState - }; + if (A !== 0) { + xc /= A + yc /= A + } else { + //console.warn("Zero area combination."); + //console.trace(); + xc /= L + yc /= L + } + for (let i = 0; i < array.length; i++) { + let e = array[i] + Ix += steiner(e.Ix, e.A, e.yc, yc) + Iy += steiner(e.Iy, e.A, e.xc, xc) } - //Maybe this will take more state parameters than just fullness. - getWeight( fullness ) { + return { A: A, xc: xc, yc: yc, Ix: Ix, Iy: Iy, maxX: maxX, minX: minX, maxY: maxY, minY: minY } +} - fullness = fullness || 0; +//x and y here refers to coordinates in the plane that is being calculated on. +function sectionCalculation({xs, ymins, ymaxs}) { + //console.group/*Collapsed*/("sectionCalculation"); + //console.info("Arguments (xs, ymins, ymaxs): ", arguments[0]); - let wi = this.weightInformation; - //Should maybe have been this.capabilities.weightInformation? + let calculations = []; + for (let i = 0; i < xs.length - 1; i++) { + let xbase = xs[i]; + let xtop = xs[i + 1]; + let ybase0 = ymins[i] || 0; + let ybase1 = ymaxs[i] || 0; + let ytop0 = ymins[i + 1] || 0; + let ytop1 = ymaxs[i + 1] || 0; - //(Fluid) container properties default to no content: - let d = wi.contentDensity || 0; - let v = wi.volumeCapacity || 0; - //Maybe we should have another handling of cargo (with variable density) + calculations.push(trapezoidCalculation(ybase0, ybase1, ytop0, ytop1, xbase, xtop)); + } - let m = wi.lightweight + d * v * fullness; - let cg; - if ( wi.fullnessCGMapping !== undefined ) { + let C = combineAreas(calculations); //Might be zero areas! - let fcgm = wi.fullnessCGMapping; - let fs = fcgm.fullnesses; - let cgs = fcgm.cgs; - //Find closest entries: - let { index: i, mu: mu } = bisectionSearch( fs, fullness ); - cg = []; - for ( let j = 0; j < 3; j ++ ) { + let output = {A: C.A, maxX: C.maxY, minX: C.minY, maxY: C.maxX, minY: C.minX, xc: C.yc, yc: C.xc, Ix: C.Iy, Iy: C.Ix, Abb: (C.maxY - C.minY) * (C.maxX - C.minX)}; + //console.info("Output: ", output); + //console.groupEnd(); + return output; +} - let c; - if ( i < fs.length - 1 ) - //Linear interpolation between closest entries: - c = lerp( cgs[ i ][ j ], cgs[ i + 1 ][ j ], mu ); - else c = cgs[ i ][ j ]; - //if (c===null || isNaN(c)) console.error("BaseObject.getWeight: Invalid value found after interpolation."); - cg.push( c ); +//For wetted area. I think this is right, but it is not tested. +//The numerical integral will not scale well with larger geometries. +//Then the full analytical solution is needed. +function bilinearArea(x1, x2, y1, y2, z11, z12, z21, z22, segs = 5) { + let [b00, b10, b01, b11] = bilinearCoeffs(x1, x2, y1, y2, z11, z12, z21, z22); + /* + z(x,y) = b00 + b10*x + b01*y + b11*xy + Partial derivative in x: b10 + b11*y + Partial derivative in y: b01 + b11*x + I think this will be right: + Tx(y) = (1, 0, b10+b11*y) + Ty(x) = (0, 1, b01+b11*x) + Then: + Tx X Ty = (-(b10+b11*y), -(b01+b11*x), 1) + |Tx X Ty| = sqrt((b10+b11*y)^2 + (b01+b11*x)^2 + 1) - } + Now, to get the area I need to integrate |Tx X Ty| over X,Y. - } else if ( wi.cg !== undefined ) { + Wolfram Alpha gave me this for the inner integral using x (indefinite): + integral sqrt((b01 + b11 x)^2 + 1 + (b10+b11*y)^2) dx = ((b01 + b11*x) sqrt((b01 + b11*x)^2 + 1 + (b10+b11*y)^2) + (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x))/(2*b11) + constant + That means this for the definite integral: + ((b01 + b11*x2)*sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + 1 + (b10+b11*y)^2*ln(sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x2))/(2*b11) - ((b01 + b11*x1)*sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x1))/(2*b11) + = + (b01 + b11*x2)*sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2)/(2*b11) + +(1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x2)/(2*b11)) + - (b01 + b11*x1)*sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2)/(2*b11) + - (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x1)/(2*b11) + = + (b01 + b11*x2)*sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2)/(2*b11) + - (b01 + b11*x1)*sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2)/(2*b11) + +(1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x2)/(2*b11)) + - (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x1)/(2*b11) - //console.log("BaseObject.getWeight: Using specified cg."); - cg = wi.cg; + The two first integrals are similar, and the two last are also similar. With A=+-(b01 + b11*xi)/(2*b11), B=(b01 + b11*xi)^2+1, C=b10 and D=b11 (where xi represents either x1 or x2, and +- represents + for x2 and - for x1), I can calculate the integral of sqrt(B+(C+D*y)^2) and multiply by A. That integral is on the same form as the first one. - } else { + The two last integrals can be represented by setting A=+-1/(2*b11), B=(b01 + b11*xi)^2+1, C=b01+b11*xi, D=b10, E=b11, and calculating the integral of (1+(D+E*y)^2)*ln(sqrt(B+(D+E*y)^2)+C), and multiplying by A. + Here is the integration result from Wolfram Alpha: + integral(1 + (D + E y)^2) log(sqrt(B + (D + E y)^2) + C) dy = (-(6 (B^2 - 2 B C^2 - 3 B + C^4 + 3 C^2) tan^(-1)((D + E y)/sqrt(B - C^2)))/sqrt(B - C^2) + (6 (B^2 - 2 B C^2 - 3 B + C^4 + 3 C^2) tan^(-1)((C (D + E y))/(sqrt(B - C^2) sqrt(B + (D + E y)^2))))/sqrt(B - C^2) + 6 (B - C^2 - 3) (D + E y) + 3 C (-3 B + 2 C^2 + 6) log(sqrt(B + (D + E y)^2) + D + E y) + 3 C (D + E y) sqrt(B + (D + E y)^2) + 6 ((D + E y)^2 + 3) (D + E y) log(sqrt(B + (D + E y)^2) + C) - 2 (D + E y)^3)/(18 E) + constant - console.warn( "BaseObject.getWeight: No cg or fullnessCGMapping supplied. Defaults to center of bounding box." ); - cg = [ 0, 0, 0.5 * this.boxDimensions.height ]; + I am glad I did not try to do this by hand. But combining these formulae, we can get an exact integral of the area of a bilinear patch. Later. Bilinear patches are not an exact representation anyway. We may opt for something else. + */ + //Simple numerical calculation of double integral: + let A = 0; + let X = x2 - x1, Y = y2 - y1; + let N = segs, M = segs; + for (let i = 0; i < N; i++) { + let x = x1 + ((i + 0.5) / N) * X; + for (let j = 0; j < M; j++) { + let y = y1 + ((j + 0.5) / M) * Y; + A += Math.sqrt((b10 + b11 * y) ** 2 + (b01 + b11 * x) ** 2 + 1); } + } + A *= X * Y / (N * M); //dx dy - let w = { mass: m, cg: { x: cg[ 0 ], y: cg[ 1 ], z: cg[ 2 ] } }; - return w; - - } + return A; +} +/*Calculates the (arithmetic) average of the area of the two possible triangulations of the quad element (using two triangles). +This requires the base of the quad to be convex. If the base is arrowhead shaped, +The calculation will fail in undefined ways. +*/ +function elementArea(v1, v2, v3, v4) { + let A1 = Math.abs(signedTriangleArea(v1, v2, v3)) + Math.abs(signedTriangleArea(v3, v4, v1)); + let A2 = Math.abs(signedTriangleArea(v2, v3, v4)) + Math.abs(signedTriangleArea(v4, v1, v2)); + let A = 0.5 * (A1 + A2); + return A; } -//@EliasHasle +function signedTriangleArea(v1, v2, v3) { + let u = Vectors.sub(v2, v1); + let v = Vectors.sub(v3, v1); + let c = Vectors.cross(u, v); + let A = 0.5 * Vectors.norm(c); + return A; +}//@EliasHasle -//Some small helpers for operations on 3D vectors -//A vector is simply defined as an object with properties x,y,z. +//I have been doing some tests here of a simplified calculation. +//The results so far indicate that, for the prism hull, the results are almost identical, except that with the simple calculation the center of volume is almost right (but wrong enough to disqualify such a simple calculation). +/*Note that the coordinate system used here has xy as a grid, with z as heights on the grid, but in the intended application, which is calculations on transverse hull offsets, this z corresponds to the vessel y axis, and y corresponds to the vessel z axis. In any application of this function, the conversion between coordinate systems must be taken care of appropriately.*/ +// xy +function patchColumnCalculation( x1, x2, y1, y2, z00, z01, z10, z11 ) { -const Vectors = { - clone: function ( v ) { + //VOLUME: + //Analysis based on a bilinear patch: + // /* + // From here I call mux for x, and muy for y. + // Integral over unit square: + // INT[x from 0 to 1, INT[y from 0 to 1, (a00 + a10*x + a01*y + a11*x*y) dy] dx] + // = INT[x from 0 to 1, (a00+a10*x+0.5*a01+0.5*a11*x) dx] + // = a00 + 0.5*a10 + 0.5*a01 + 0.25*a11 + // Note that by expanding a00,a10,a01,a11, it is demonstrated that this (rather unsurprisingly) is exactly equivalent to taking the average z offset of the control points. + // */ + let X = x2 - x1; + let Y = y2 - y1; + let Ab = X * Y; //area of base of patch column + //let zAvg = (a00 + 0.5*a10 + 0.5*a01 + 0.25*a11); + let zAvg = 0.25 * ( z00 + z01 + z10 + z11 ); //equivalent + let V = Math.abs( Ab * zAvg ); //works - return { x: v.x, y: v.y, z: v.z }; + //CENTER OF VOLUME + let zc = 0.5 * zAvg; - }, + //Very approximate center of volume + //(does not account for different signs on z values, + //but that should be OK for hull offsets) + //let xc = (x1*(z00+z01)+x2*(z10+z11))/((z00+z01+z10+z11) || 1); + //let yc = (y1*(z00+z10)+y2*(z01+z11))/((z00+z01+z10+z11) || 1); - scale: function ( v, s ) { + // /* + // To find xc properly, I need to integrate x*z over the unit square, divide by zAvg(?) and scale and translate to ship coordinates afterwards: + // INT[x from 0 to 1, INT[y from 0 to 1, x*(a00 + a10*x + a01*y + a11*x*y) dy] dx] = + // INT[x from 0 to 1, INT[y from 0 to 1, (a00*x + a10*x^2 + a01*xy + a11*x^2*y) dy] dx] = + // INT[x from 0 to 1, (a00*x + a10*x^2 + 0.5*a01*x + 0.5*a11*x^2) dx] + // = (0.5*a00 + a10/3 + 0.25*a01 + a11/6) + //Trying to expand the coeffs to original z offsets: + // = (0.5*z00 + (z10-z00)/3 + 0.25*(z01-z00) + (z00+z00-z01-z10)/6) + // = ((1/12)*z00 + (1/6)*z10 + (1/12)*z01 + (1/6)*z00) + //Divide by zAvg to get muxc, then scale and translate to xc. + let xc = x1 + X * ( ( ( 1 / 12 ) * z00 + ( 1 / 6 ) * z10 + ( 1 / 12 ) * z01 + ( 1 / 6 ) * z11 ) / ( zAvg || 1 ) ); + //console.log("x1=%.2f, X=%.2f, muxc = %.2f", x1, X, (((1/12)*z00 + (1/6)*z10 + (1/12)*z01 + (1/6)*z11) / (zAvg || 1))); + //Similar for yc (modified symmetrically) + let yc = y1 + Y * ( ( ( 1 / 12 ) * z00 + ( 1 / 12 ) * z10 + ( 1 / 6 ) * z01 + ( 1 / 6 ) * z11 ) / ( zAvg || 1 ) ); + let [ a00, a10, a01, a11 ] = bilinearUnitSquareCoeffs( z00, z01, z10, z11 ); - return { x: s * v.x, y: s * v.y, z: s * v.z }; + //console.log("Patch column Cv = (%.2f, %.2f, %.2f)", xc,yc,zc); - }, + //AREA + //These two methods give very similar results, within about 1% difference for the fishing boat hull (used in PX121.json). + //Simple triangle average approximation for area (works) + /*let As = elementArea( + {x: x1, y: y1, z: z00}, + {x: x1, y: y2, z: z01}, + {x: x2, y: y1, z: z10}, + {x: x2, y: y2, z: z11});*/ + //Bilinear area calculation. Works too, but is currently numerical, and quite complex (which means it is bug-prone and hard to maintain). But it is more exact, even with just a few segments for numerical integration (the last, optional, parameter) + let As = Math.abs( bilinearArea( x1, x2, y1, y2, z00, z01, z10, z11 ) ); - norm: function ( v ) { + return { Ab: Ab, As: As, V: V, Cv: { x: xc, y: yc, z: zc } }; - return Math.sqrt( v.x ** 2 + v.y ** 2 + v.z ** 2 ); +} - }, +//Input: array of objects with calculation results for elements. +//Output: the combined results. +function combineVolumes( array ) { - normalize: function ( v ) { + let V = 0; + let As = 0; + let Cv = { x: 0, y: 0, z: 0 }; + let L = array.length; + //if (L===0) return {V,As,Cv}; + for ( let i = 0; i < L; i ++ ) { - let l = norm( v ); - return { x: v.x / l, y: v.y / l, z: v.z / l }; + let e = array[ i ]; + V += e.V; + As += e.As; //typically wetted area + //console.log(e.Cv); + Cv = Vectors.add( Cv, Vectors.scale( e.Cv, e.V ) ); - }, + } - normSquared: function ( v ) { + Cv = Vectors.scale( Cv, 1 / ( V || L || 1 ) ); - return v.x ** 2 + v.y ** 2 + v.z ** 2; + //console.info("combineVolumes: Combined Cv is (" + Cv.x + ", " + Cv.y + ", " + Cv.z + ")."); - }, + return { V, As, Cv };//{V: V, As: As, Cv: Cv}; - /*Adds two or more vectors given as individual parameters, - and returns a new vector that is the component-wise - sum of the input vectors.*/ - add: function ( u, v, ...rest ) { +} +//@MrEranwe +//@EliasHasle - if ( rest.length > 0 ) return Vectors.sum( [ u, v ] + rest ); - return { x: u.x + v.x, y: u.y + v.y, z: u.z + v.z }; +"use strict"; +//Elias notes: +//LCB and LCG were obviously considered in another coordinate system than we are using. I have corrected this, assuming that the wrong coordinate system had the origin centered longitudinally. +//The hull mass is off by several orders of magnitude. Checking the paper, it seems likely that the "typical" K parameters are aimed at producing units of tonnes, not kg. +//It is not mathematically correct to strip down the structural weight calculation the way it is done here, because the exponentiation (E^1.36) cannot be simply decomposed as a sum of exponentiated terms (with the same exponent). +//Elias has only reviewed and modified the hull weight calculation. - }, +// This function estimates the structural weight of the hull. This includes the weight of the basic hull to its depth amidships. - //Takes an array of vectors as input, and returns a new vector - //that is the component-wise sum of the input vectors. - sum: function ( vectors ) { +// It is based on Watson and Gilfillan modeling approach using a specific modification of the Lloyd’s Equipment Numeral E as the independent variable. +// +// +// Inputs +// K is the structural weight coefficient. Parsons, chapter 11, table 11.VII. +// L is LWL or LBP +// B is molded beam +// T is molded draft +// D is molded depth +// Superstructures and shiphouses are not being considered in the weight +// CB is the block coefficient +// LCB is the Longitudinal Center of Bouyancy +// +// Return +// It returns an object on the format {mass:1234, cg: {x:4,y:3,z:2}}, where the unit of mass is unclear, and x,y,z is in meters from aft,center,bottom, respectively. - let S = { x: 0, y: 0, z: 0 }; - for ( let i = 0; i < vectors.length; i ++ ) { +function parametricWeightHull(K, L, B, T, D, CB, Fn) { - let v = vectors[ i ]; - S.x += v.x; - S.y += v.y; - S.z += v.z; + // Calculates estimated structural weight + // E is the Lloyd’s Equipment Numeral + let E = L * (B + T) + 0.85 * L * (D - T); + // CbCorrected is the estimated corrected block coefficient + let CBCorrected = CB + (1 - CB) * ((0.8 * D - T) / (3 * T)); + // W is the estimated structural weight + let W = K * Math.pow(E, 1.36) * (1 + 0.5 * (CBCorrected - 0.7)); - } + // Calculates LCG and VCG + // VCGHull is the Vertical Center of Gravity of the hull + let VCGHull = 0; + if (L < 120) { + VCGHull = 0.01 * D * (46.6 + 0.135 * (0.81 - CB) * Math.pow(L / D, 2)) + 0.008 * D * (L / D - 6.5); + } + else { + VCGHull = 0.01 * D * (46.6 + 0.135 * (0.81 - CB) * Math.pow(L / D, 2)); + } + // LCB is the longitudinal Center of Buoyancy converted from + // percentage plus forward of amidships to meters from aft + let LCB = Fn ? 0.5 * L + (9.7 - 45 * Fn) * L / 100 : L * 0.516; + // LCGHull is the Longitudinal Center of Gravity of the hull in meters from aft + let LCGHull = LCB - 0.15 * L / 100; - return S; + // Returns the object - }, + return {mass: W, cg: {x: LCGHull, y: 0, z: VCGHull}}; +} - //Takes two vector parameters u,v, and returns the vector u-v. - sub: function ( u, v ) { +// This function estimates the remainder of the Dead Ship Weight. It includes the fuel, the lube oil, the fresh water, the crew and the provisions and stores. +// +// +// Inputs +// Co is the outfit weight coefficient. Parsons Chapter 11 Figure 11.17. Pag 24. +// LBP is the Lenght Between Perpendiculars. +// D is molded depth +// +// Return +// It returns an object with the properties mass. - //return Vectors.add(u, Vectors.scale(v, -1)); //equivalent - return { x: u.x - v.x, y: u.y - v.y, z: u.z - v.z }; +function parametricWeightDeadweight(SFR, MCR, speed, person, day) { - }, + // Calculates estimated weight + let Wfo = SFR * MCR * speed * 1.1; // Fuel oil Weight + let Wlo = 0; // Lube oil Weight + if (speed > 10) { + Wlo = 15; + } + else { + Wlo = 20 + } + let Wfw = 0.17 * person; // Weight of fresh water + let Wce = 0.17 * person; // Weight of crew and effects + let Wpr = 0.01 * person * day; // Weight of provisions and stores + let W = Wfo + Wlo + Wfw + Wce + Wpr; // Total weigth - dot: function ( u, v ) { - return u.x * v.x + u.y * v.y + u.z * v.z; + // VCGOut is the Vertical Center of Gravity of the Deadweight. Depends on designer + // LCGOut is the Longitudinal Center of Gravity of the Deadweight. Depends on designer - }, + // Returns the object - cross: function ( u, v ) { + return {mass: W}; +} - return { - x: u.y * v.z - u.z * v.y, - y: u.z * v.x - u.x * v.z, - z: u.x * v.y - u.y * v.x - }; +// This function estimates the structural weight of the machinery, main engine(s) and the remainder of the machinery weight. +// +// +// Inputs +// MCR is the total capacity of all generators in kW. +// hdb is the innerbootom height of the engine room +// Der is the height og the overhead of the engine room +// L is LWL or LBP +// B is molded beam +// T is molded draft +// +// Return +// It returns an object with the properties mass and the VCG. - }, +function parametricWeightMachinery(MCR, hdb, Der, B, T, L, test) { + // Calculates estimated machinery weight + let W = 0.72 * Math.pow(MCR, 0.78); + // Calculates LCG and VCG - mulComponents: function ( u, v ) { + // req1 and req2 are the Coast Guard requirements for the hdb + let req1 = (32 * B + 190 * Math.sqrt(T)) / 1000; + let req2 = (45.7 + 0.417 * L) / 100; + let reqmax = Math.max(req1, req2, hdb); - return { - x: u.x * v.x, - y: u.y * v.y, - z: u.z * v.z - }; + // VCGMach is the Vertical Center of Gravity of the machinery + let VCGMach = hdb + 0.35 * (Der - hdb); - }, + // LCGMach is the Longitudinal Center of Gravity of the machinery. Depends on designer - //Return the result of rotating the vector v by angles r={x,y,z} in radians. - //Intrinsic ZYX order (yaw,pitch,roll) is achieved by applying world axis rotations in XYZ order. - rotateTaitBryan: function ( v, r ) { + // Returns the object - let c, s; + return {mass: W, VCG: VCGMach}; +} - //Rotate around x axis - c = Math.cos( r.x ); - s = Math.sin( r.x ); - v = { - x: v.x, - y: v.y * c - v.z * s, - z: v.y * s + v.z * c - }; - //Then around y axis - c = Math.cos( r.y ); - s = Math.sin( r.y ); - v = { - x: v.z * s + v.x * c, - y: v.y, - z: v.z * c - v.x * s - }; +// This function estimates the remainder of the Light Ship Weight. It includes outfit: electrical plant, distributive auxiliary systems and hull engineering: bits, chocks, hatch covers... +// +// +// Inputs +// Co is the outfit weight coefficient. Parsons Chapter 11 Figure 11.17. Pag 24. +// LBP is the Lenght Between Perpendiculars. +// D is molded depth +// +// Return +// It returns an object with the properties mass and VCG. - //Then around z axis - c = Math.cos( r.z ); - s = Math.sin( r.z ); - v = { - x: v.x * c - v.y * s, - y: v.x * s + v.y * c, - z: v.z - }; +function parametricWeightOutfit(Co, LBP, D) { - return v; + // Calculates estimated weight + let W = Co * LBP; + // VCGOut is the Vertical Center of Gravity of the outfits + let VCGOut = 0; + if (LBP < 125) { + VCGOut = D + 1.25 + } + else if (LBP < 250) { + VCGOut = D + 1.25 + 0.01 * (LBP - 125) + } + else { + VCGOut = D + 2.5 } -}; - -class DerivedObject extends JSONSpecObject { - constructor( specification, baseObjects ) { + // LCGOut is the Longitudinal Center of Gravity of the Outfits. Depends on designer - super( specification, baseObjects ); + // Returns the object - } + return {mass: W, VCG: VCGOut}; +} +//@EliasHasle - setFromSpecification( spec ) { +//Very unoptimized for now. +function combineWeights(array) { + let M = array.reduce((sum, e) => sum + e.mass, 0); + let cgms = array.map(e => Vectors.scale(e.cg, e.mass)); + let CG = Vectors.scale(Vectors.sum(cgms), 1 / M); - this.id = spec.id; - this.group = spec.group || null; - this.affiliations = spec.affiliations; + return {mass: M, cg: CG}; +}//@EliasHasle - if ( typeof spec.baseObject === "string" ) { +/*Base class for objects that are constructed from +a literal object. - this.baseObject = this.baseObjects[ spec.baseObject ]; +Constructors can take more parameters than the specification, but the specification must be the first parameter. - } else { +setFromSpecification will typically be overridden by derived classes. Overriding implementations will typically do some sanity checking. - this.baseObject = new BaseObject( spec.baseObject ); +getSpecification will also typically be overridden. The default implementation here is just a sketch. Maybe not even correct for the simplest subclasses. - } - - this.referenceState = spec.referenceState; - //this.referenceStateVersion = 0; - this.style = spec.style || {}; - return this; - - } - - getSpecification() { - - let spec = { - id: this.id, - group: this.group, - affiliations: this.affiliations, - referenceState: this.referenceState, - style: this.style - }; - if ( this.baseObjects[ this.baseObject.id ] !== undefined ) { - - spec.baseObject = this.baseObject.id; - - } else { - - spec.baseObject = this.baseObject.getSpecification(); - - } - - return spec; +Maybe this can be improved by implementing fromJSON and to toJSON methods. +*/ +function JSONSpecObject(specification) { + if (specification === null) { + console.warn("JSONSpecObject: null specification provided. Defaulting to empty specification."); + specification = {}; } - - getWeight( state ) { - - let oState = state.getObjectState( this ); - - //Support disabled objects: - if ( oState.exists === false ) { - - return { mass: 0, cg: { x: 0, y: 0, z: 0 } }; - + else if (typeof specification === "object") {} + /*else if (typeof specification === "string") { + try { + specification = JSON.parse(specification); + } catch(e) { + console.error("JSONSpecObject: "+ e.message + "\n Defaulting to empty specification."); + specification = {}; } - - let p = { - x: oState.xCentre, - y: oState.yCentre, - z: oState.zBase - }; - - let w = this.baseObject.getWeight( oState.fullness ); - let m = w.mass; - let cg = Vectors.add( p, w.cg ); - - if ( isNaN( cg.x + cg.y + cg.z ) ) { - - console.error( "DerivedObject.getWeight: returning NaN values." ); - + }*/ + else { + if (typeof specification !== "undefined") { + console.error("JSONSpecObject: Invalid constructor parameter. Defaulting to empty specification."); } - - return { mass: m, cg: cg }; - + specification = {}; } - + this.setFromSpecification(specification); } - -//@MrEranwe -//@EliasHasle - -//Elias notes: -//LCB and LCG were obviously considered in another coordinate system than we are using. I have corrected this, assuming that the wrong coordinate system had the origin centered longitudinally. -//The hull mass is off by several orders of magnitude. Checking the paper, it seems likely that the "typical" K parameters are aimed at producing units of tonnes, not kg. -//It is not mathematically correct to strip down the structural weight calculation the way it is done here, because the exponentiation (E^1.36) cannot be simply decomposed as a sum of exponentiated terms (with the same exponent). -//Elias has only reviewed and modified the hull weight calculation. - -// This function estimates the structural weight of the hull. This includes the weight of the basic hull to its depth amidships. - -// It is based on Watson and Gilfillan modeling approach using a specific modification of the Lloyd’s Equipment Numeral E as the independent variable. -// -// -// Inputs -// K is the structural weight coefficient. Parsons, chapter 11, table 11.VII. -// L is LWL or LBP -// B is molded beam -// T is molded draft -// D is molded depth -// Superstructures and shiphouses are not being considered in the weight -// CB is the block coefficient -// LCB is the Longitudinal Center of Bouyancy -// -// Return -// It returns an object on the format {mass:1234, cg: {x:4,y:3,z:2}}, where the unit of mass is unclear, and x,y,z is in meters from aft,center,bottom, respectively. - -function parametricWeightHull( K, L, B, T, D, CB, Fn ) { - - // Calculates estimated structural weight - // E is the Lloyd’s Equipment Numeral - let E = L * ( B + T ) + 0.85 * L * ( D - T ); - // CbCorrected is the estimated corrected block coefficient - let CBCorrected = CB + ( 1 - CB ) * ( ( 0.8 * D - T ) / ( 3 * T ) ); - // W is the estimated structural weight - let W = K * Math.pow( E, 1.36 ) * ( 1 + 0.5 * ( CBCorrected - 0.7 ) ); - - // Calculates LCG and VCG - // VCGHull is the Vertical Center of Gravity of the hull - let VCGHull = 0; - if ( L < 120 ) { - - VCGHull = 0.01 * D * ( 46.6 + 0.135 * ( 0.81 - CB ) * Math.pow( L / D, 2 ) ) + 0.008 * D * ( L / D - 6.5 ); - - } else { - - VCGHull = 0.01 * D * ( 46.6 + 0.135 * ( 0.81 - CB ) * Math.pow( L / D, 2 ) ); - +JSONSpecObject.prototype = Object.create(Object.prototype); +Object.assign(JSONSpecObject.prototype, { + constructor: JSONSpecObject, + setFromSpecification: function(specification) { + //No sanity checking by default. + Object.assign(this, specification); + return this; + }, + getSpecification: function() { + let spec = {}; + for (k of Object.keys(this)) { + if (this.hasOwnProperty(k)) spec[k] = this[k]; + } + return spec; + }, + //toJSON is the standard way. Added here for testing. + toJSON: function() { + return this.getSpecification(); + }, + //fromJSON is added as an alternative and better name. + fromJSON: function(spec) { + return this.setFromSpecification(spec); } +});//@EliasHasle - // LCB is the longitudinal Center of Buoyancy converted from - // percentage plus forward of amidships to meters from aft - let LCB = Fn ? 0.5 * L + ( 9.7 - 45 * Fn ) * L / 100 : L * 0.516; - // LCGHull is the Longitudinal Center of Gravity of the hull in meters from aft - let LCGHull = LCB - 0.15 * L / 100; - - // Returns the object - - return { mass: W, cg: { x: LCGHull, y: 0, z: VCGHull } }; - -} - -//@EliasHasle - -//All inputs are numbers. The axes are given by a single coordinate. -function steiner( I, A, sourceAxis, targetAxis ) { - - return I + A * ( sourceAxis - targetAxis ) ** 2; +/* +Notes: +For calculated values, I envision a lazy calculation pattern, where all properties involved in calculations are only accessed by specialized getters and setters, and calculated properties have some kind of needsUpdate flag or version number (that is set by any setters that will directly or indirectly affect the property). When, and only when, running the getter for the given property, the flag/version is checked, and if false (same version as in cache) the getter just returns the stored value. If true, the getter starts the calculation of the value, invoking other getters. -} - -//Calculate area, center, Ix, Iy. -function trapezoidCalculation( xbase0, xbase1, xtop0, xtop1, ybase, ytop ) { - - let a = xbase1 - xbase0; - let b = xtop1 - xtop0; - let h = ytop - ybase; - if ( a < 0 || b < 0 || h < 0 ) { - - console.warn( "trapezoidCalculation: Unsupported input. Possibly not a valid trapezoid." ); - - } +Suggested calculations to do: +- Inertia matrix (will need more detailed properties of parts). +*/ - let A = 0.5 * ( a + b ) * h; - let yc = ( a == 0 && b == 0 ) ? ybase + 0.5 * h : ybase + h * ( 2 * a + b ) / ( 3 * ( a + b ) ); - let d = xbase0 + 0.5 * a; //shorthand - let xc = h === 0 ? 0.25 * ( xbase0 + xbase1 + xtop0 + xtop1 ) : d + ( xtop0 + 0.5 * b - d ) * ( yc - ybase ) / h; - let Ix = ( a == 0 && b == 0 ) ? 0 : h ** 3 * ( a ** 2 + 4 * a * b + b ** 2 ) / ( 36 * ( a + b ) ); +function Ship( specification ) { - //For Iy I must decompose (I think negative results will work fine): - let Art1 = 0.5 * ( xtop0 - xbase0 ) * h; - let xcrt1 = xbase0 + ( xtop0 - xbase0 ) / 3; - let Iyrt1 = ( xtop0 - xbase0 ) ** 3 * h / 36; - let Arec = ( xbase1 - xtop0 ) * h; - let xcrec = 0.5 * ( xtop0 + xbase1 ); - let Iyrec = ( xbase1 - xtop0 ) ** 3 * h / 12; - let Art2 = 0.5 * ( xbase1 - xtop1 ) * h; - let xcrt2 = ( xtop1 + ( xbase1 - xtop1 ) / 3 ); - let Iyrt2 = ( xbase1 - xtop1 ) ** 3 * h / 36; - - let Iy = steiner( Iyrt1, Art1, xcrt1, xc ) - + steiner( Iyrec, Arec, xcrec, xc ) - + steiner( Iyrt2, Art2, xcrt2, xc ); - - let maxX = Math.max.apply( null, [ xbase0, xbase1, xtop0, xtop1 ] ); - let minX = Math.min.apply( null, [ xbase0, xbase1, xtop0, xtop1 ] ); - let maxY = Math.max( ybase, ytop ); - let minY = Math.min( ybase, ytop ); - - return { A: A, xc: xc, yc: yc, Ix: Ix, Iy: Iy, maxX: maxX, minX: minX, maxY: maxY, minY: minY }; + JSONSpecObject.call( this, specification ); } -function combineAreas( array ) { - - let A = 0; - let xc = 0; - let yc = 0; - let maxX = 0, - minX = 0, - maxY = 0, - minY = 0; - let L = array.length; - let foundMinY = false; - let foundMaxY = false; - for ( let i = 0; i < L; i ++ ) { - - let e = array[ i ]; - A += e.A; - xc += e.xc * e.A; - yc += e.yc * e.A; - if ( ! isNaN( e.maxX ) && e.maxX > maxX ) maxX = e.maxX; - if ( ! isNaN( e.minX ) && e.minX < minX ) minX = e.minX; - if ( ! isNaN( e.maxY ) && e.maxY > maxY && ! foundMaxY && foundMinY ) { - - maxY = e.maxY; - if ( e.A === 0 ) { +Ship.prototype = Object.create( JSONSpecObject.prototype ); +Object.assign( Ship.prototype, { + constructor: Ship, + setFromSpecification: function ( specification ) { - foundMaxY = true; + this.attributes = specification.attributes || {}; + this.structure = new Structure( specification.structure/*,this*/ ); + //baseObjects and derivedObjects are arrays in the specification, but are objects (hashmaps) in the constructed ship object: + this.baseObjects = {}; + for ( let i = 0; i < specification.baseObjects.length; i ++ ) { - } + let os = specification.baseObjects[ i ]; + this.baseObjects[ os.id ] = new BaseObject( os ); } - if ( ! isNaN( e.minY ) && ! foundMinY ) { - - if ( e.A !== 0 ) { - - minY = e.minY; - foundMinY = true; + this.derivedObjects = {}; + for ( let i = 0; i < specification.derivedObjects.length; i ++ ) { - } + let os = specification.derivedObjects[ i ]; + this.derivedObjects[ os.id ] = new DerivedObject( os, this.baseObjects ); } - } + this.designState = new ShipState( specification.designState ); + return this; - if ( ! foundMaxY ) maxY = array[ L - 1 ].maxY; //if foundMaxY is false then the ship is a barge and a different logic must apply @ferrari212 + }, + getSpecification: function () { - let Ix = 0; - let Iy = 0; + let specification = {}; + specification.attributes = this.attributes; + specification.structure = this.structure.getSpecification(); - if ( A !== 0 ) { + specification.baseObjects = Object.values( this.baseObjects ).map( o => o.getSpecification() ); + specification.derivedObjects = Object.values( this.derivedObjects ).map( o => o.getSpecification() ); - xc /= A; - yc /= A; + specification.designState = this.designState.getSpecification(); - } else { + return specification; - //console.warn("Zero area combination."); - //console.trace(); - xc /= L; - yc /= L; + }, + //This should probably be separated in lightweight and deadweight + //Then this function should be replaced by a getDisplacement + getWeight: function ( shipState ) { - } + shipState = shipState || this.designState; - for ( let i = 0; i < array.length; i ++ ) { + let components = []; - let e = array[ i ]; - Ix += steiner( e.Ix, e.A, e.yc, yc ); - Iy += steiner( e.Iy, e.A, e.xc, xc ); + components.push( + this.structure.getWeight( this.designState ) + ); - } + //DEBUG + //console.log(components); - return { A: A, xc: xc, yc: yc, Ix: Ix, Iy: Iy, maxX: maxX, minX: minX, maxY: maxY, minY: minY }; + for ( let o of Object.values( this.derivedObjects ) ) { -} + components.push( o.getWeight( shipState ) ); -//x and y here refers to coordinates in the plane that is being calculated on. -function sectionCalculation( { xs, ymins, ymaxs } ) { + } - //console.group/*Collapsed*/("sectionCalculation"); - //console.info("Arguments (xs, ymins, ymaxs): ", arguments[0]); + var W = combineWeights( components ); + //console.info("Calculated weight object: ", W); + return W; - let calculations = []; - for ( let i = 0; i < xs.length - 1; i ++ ) { + }, + calculateDraft: function ( shipState, epsilon = 0.001, rho = 1025 ) { - let xbase = xs[ i ]; - let xtop = xs[ i + 1 ]; - let ybase0 = ymins[ i ] || 0; - let ybase1 = ymaxs[ i ] || 0; - let ytop0 = ymins[ i + 1 ] || 0; - let ytop1 = ymaxs[ i + 1 ] || 0; + let w = this.getWeight( shipState ); + let M = w.mass; + return this.structure.hull.calculateDraftAtMass( M, epsilon, rho ); - calculations.push( trapezoidCalculation( ybase0, ybase1, ytop0, ytop1, xbase, xtop ) ); + }, + //Separates between longitudinal and transverse GM + //To avoid confusion, no "default" GM or BM is specified in the output. + calculateStability: function ( shipState ) { - } + let w = this.getWeight( shipState ); + let KG = w.cg.z; + let LCG = w.cg.x; + let T = this.structure.hull.calculateDraftAtMass( w.mass ); + let { BMt, BMl, KB, LCB, LCF, LWL, BWL } = this.structure.hull.calculateAttributesAtDraft( T ); + let GMt = KB + BMt - KG; + let GMl = KB + BMl - KG; - let C = combineAreas( calculations ); //Might be zero areas! + // avaiable just for small angles < 3° + // this calculation can be incorporated to Vessesl.js with no problem + let trim = ( LCB - LCG ) / GMl; + let draftfp = 0; + let draftap = 0; + let trimd = 0; - let output = { A: C.A, maxX: C.maxY, minX: C.minY, maxY: C.maxX, minY: C.minX, xc: C.yc, yc: C.xc, Ix: C.Iy, Iy: C.Ix, Abb: ( C.maxY - C.minY ) * ( C.maxX - C.minX ) }; - //console.info("Output: ", output); - //console.groupEnd(); - return output; + if ( trim < Math.tan( 3 * Math.PI / 180 ) ) { -} + draftfp = T - ( LWL - LCF ) * trim; + draftap = T + ( LCF ) * trim; + trimd = draftfp - draftap; -//For wetted area. I think this is right, but it is not tested. -//The numerical integral will not scale well with larger geometries. -//Then the full analytical solution is needed. -function bilinearArea( x1, x2, y1, y2, z11, z12, z21, z22, segs = 5 ) { + } else { - let [ b00, b10, b01, b11 ] = bilinearCoeffs( x1, x2, y1, y2, z11, z12, z21, z22 ); - /* - z(x,y) = b00 + b10*x + b01*y + b11*xy - Partial derivative in x: b10 + b11*y - Partial derivative in y: b01 + b11*x - I think this will be right: - Tx(y) = (1, 0, b10+b11*y) - Ty(x) = (0, 1, b01+b11*x) - Then: - Tx X Ty = (-(b10+b11*y), -(b01+b11*x), 1) - |Tx X Ty| = sqrt((b10+b11*y)^2 + (b01+b11*x)^2 + 1) + draftfp = null; + draftap = null; + trimd = null; - Now, to get the area I need to integrate |Tx X Ty| over X,Y. + } - Wolfram Alpha gave me this for the inner integral using x (indefinite): - integral sqrt((b01 + b11 x)^2 + 1 + (b10+b11*y)^2) dx = ((b01 + b11*x) sqrt((b01 + b11*x)^2 + 1 + (b10+b11*y)^2) + (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x))/(2*b11) + constant - That means this for the definite integral: - ((b01 + b11*x2)*sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + 1 + (b10+b11*y)^2*ln(sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x2))/(2*b11) - ((b01 + b11*x1)*sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x1))/(2*b11) - = - (b01 + b11*x2)*sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2)/(2*b11) - +(1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x2)/(2*b11)) - - (b01 + b11*x1)*sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2)/(2*b11) - - (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x1)/(2*b11) - = - (b01 + b11*x2)*sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2)/(2*b11) - - (b01 + b11*x1)*sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2)/(2*b11) - +(1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x2)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x2)/(2*b11)) - - (1 + (b10+b11*y)^2)*ln(sqrt((b01 + b11*x1)^2 + 1 + (b10+b11*y)^2) + b01 + b11*x1)/(2*b11) - - The two first integrals are similar, and the two last are also similar. With A=+-(b01 + b11*xi)/(2*b11), B=(b01 + b11*xi)^2+1, C=b10 and D=b11 (where xi represents either x1 or x2, and +- represents + for x2 and - for x1), I can calculate the integral of sqrt(B+(C+D*y)^2) and multiply by A. That integral is on the same form as the first one. - - The two last integrals can be represented by setting A=+-1/(2*b11), B=(b01 + b11*xi)^2+1, C=b01+b11*xi, D=b10, E=b11, and calculating the integral of (1+(D+E*y)^2)*ln(sqrt(B+(D+E*y)^2)+C), and multiplying by A. - Here is the integration result from Wolfram Alpha: - integral(1 + (D + E y)^2) log(sqrt(B + (D + E y)^2) + C) dy = (-(6 (B^2 - 2 B C^2 - 3 B + C^4 + 3 C^2) tan^(-1)((D + E y)/sqrt(B - C^2)))/sqrt(B - C^2) + (6 (B^2 - 2 B C^2 - 3 B + C^4 + 3 C^2) tan^(-1)((C (D + E y))/(sqrt(B - C^2) sqrt(B + (D + E y)^2))))/sqrt(B - C^2) + 6 (B - C^2 - 3) (D + E y) + 3 C (-3 B + 2 C^2 + 6) log(sqrt(B + (D + E y)^2) + D + E y) + 3 C (D + E y) sqrt(B + (D + E y)^2) + 6 ((D + E y)^2 + 3) (D + E y) log(sqrt(B + (D + E y)^2) + C) - 2 (D + E y)^3)/(18 E) + constant - - I am glad I did not try to do this by hand. But combining these formulae, we can get an exact integral of the area of a bilinear patch. Later. Bilinear patches are not an exact representation anyway. We may opt for something else. - */ - - //Simple numerical calculation of double integral: - let A = 0; - let X = x2 - x1, Y = y2 - y1; - let N = segs, M = segs; - for ( let i = 0; i < N; i ++ ) { - - let x = x1 + ( ( i + 0.5 ) / N ) * X; - for ( let j = 0; j < M; j ++ ) { - - let y = y1 + ( ( j + 0.5 ) / M ) * Y; - A += Math.sqrt( ( b10 + b11 * y ) ** 2 + ( b01 + b11 * x ) ** 2 + 1 ); - - } - - } - - A *= X * Y / ( N * M ); //dx dy - - return A; - -} - -//@EliasHasle - -//I have been doing some tests here of a simplified calculation. -//The results so far indicate that, for the prism hull, the results are almost identical, except that with the simple calculation the center of volume is almost right (but wrong enough to disqualify such a simple calculation). -/*Note that the coordinate system used here has xy as a grid, with z as heights on the grid, but in the intended application, which is calculations on transverse hull offsets, this z corresponds to the vessel y axis, and y corresponds to the vessel z axis. In any application of this function, the conversion between coordinate systems must be taken care of appropriately.*/ -// xy -function patchColumnCalculation( x1, x2, y1, y2, z00, z01, z10, z11 ) { - - //VOLUME: - //Analysis based on a bilinear patch: - // /* - // From here I call mux for x, and muy for y. - // Integral over unit square: - // INT[x from 0 to 1, INT[y from 0 to 1, (a00 + a10*x + a01*y + a11*x*y) dy] dx] - // = INT[x from 0 to 1, (a00+a10*x+0.5*a01+0.5*a11*x) dx] - // = a00 + 0.5*a10 + 0.5*a01 + 0.25*a11 - // Note that by expanding a00,a10,a01,a11, it is demonstrated that this (rather unsurprisingly) is exactly equivalent to taking the average z offset of the control points. - // */ - let X = x2 - x1; - let Y = y2 - y1; - let Ab = X * Y; //area of base of patch column - //let zAvg = (a00 + 0.5*a10 + 0.5*a01 + 0.25*a11); - let zAvg = 0.25 * ( z00 + z01 + z10 + z11 ); //equivalent - let V = Math.abs( Ab * zAvg ); //works - - //CENTER OF VOLUME - let zc = 0.5 * zAvg; - - //Very approximate center of volume - //(does not account for different signs on z values, - //but that should be OK for hull offsets) - //let xc = (x1*(z00+z01)+x2*(z10+z11))/((z00+z01+z10+z11) || 1); - //let yc = (y1*(z00+z10)+y2*(z01+z11))/((z00+z01+z10+z11) || 1); - - // /* - // To find xc properly, I need to integrate x*z over the unit square, divide by zAvg(?) and scale and translate to ship coordinates afterwards: - // INT[x from 0 to 1, INT[y from 0 to 1, x*(a00 + a10*x + a01*y + a11*x*y) dy] dx] = - // INT[x from 0 to 1, INT[y from 0 to 1, (a00*x + a10*x^2 + a01*xy + a11*x^2*y) dy] dx] = - // INT[x from 0 to 1, (a00*x + a10*x^2 + 0.5*a01*x + 0.5*a11*x^2) dx] - // = (0.5*a00 + a10/3 + 0.25*a01 + a11/6) - //Trying to expand the coeffs to original z offsets: - // = (0.5*z00 + (z10-z00)/3 + 0.25*(z01-z00) + (z00+z00-z01-z10)/6) - // = ((1/12)*z00 + (1/6)*z10 + (1/12)*z01 + (1/6)*z00) - //Divide by zAvg to get muxc, then scale and translate to xc. - let xc = x1 + X * ( ( ( 1 / 12 ) * z00 + ( 1 / 6 ) * z10 + ( 1 / 12 ) * z01 + ( 1 / 6 ) * z11 ) / ( zAvg || 1 ) ); - //console.log("x1=%.2f, X=%.2f, muxc = %.2f", x1, X, (((1/12)*z00 + (1/6)*z10 + (1/12)*z01 + (1/6)*z11) / (zAvg || 1))); - //Similar for yc (modified symmetrically) - let yc = y1 + Y * ( ( ( 1 / 12 ) * z00 + ( 1 / 12 ) * z10 + ( 1 / 6 ) * z01 + ( 1 / 6 ) * z11 ) / ( zAvg || 1 ) ); - - //console.log("Patch column Cv = (%.2f, %.2f, %.2f)", xc,yc,zc); - - //AREA - //These two methods give very similar results, within about 1% difference for the fishing boat hull (used in PX121.json). - //Simple triangle average approximation for area (works) - /*let As = elementArea( - {x: x1, y: y1, z: z00}, - {x: x1, y: y2, z: z01}, - {x: x2, y: y1, z: z10}, - {x: x2, y: y2, z: z11});*/ - //Bilinear area calculation. Works too, but is currently numerical, and quite complex (which means it is bug-prone and hard to maintain). But it is more exact, even with just a few segments for numerical integration (the last, optional, parameter) - let As = Math.abs( bilinearArea( x1, x2, y1, y2, z00, z01, z10, z11 ) ); - - return { Ab: Ab, As: As, V: V, Cv: { x: xc, y: yc, z: zc } }; - -} - -//Input: array of objects with calculation results for elements. -//Output: the combined results. -function combineVolumes( array ) { - - let V = 0; - let As = 0; - let Cv = { x: 0, y: 0, z: 0 }; - let L = array.length; - //if (L===0) return {V,As,Cv}; - for ( let i = 0; i < L; i ++ ) { - - let e = array[ i ]; - V += e.V; - As += e.As; //typically wetted area - //console.log(e.Cv); - Cv = Vectors.add( Cv, Vectors.scale( e.Cv, e.V ) ); - - } - - Cv = Vectors.scale( Cv, 1 / ( V || L || 1 ) ); - - //console.info("combineVolumes: Combined Cv is (" + Cv.x + ", " + Cv.y + ", " + Cv.z + ")."); - - return { V, As, Cv };//{V: V, As: As, Cv: Cv}; - -} - -class Hull extends JSONSpecObject { - - constructor( spec ) { - - super( spec ); - - } - - setFromSpecification( spec ) { - - this.halfBreadths = spec.halfBreadths; - //this.buttockHeights = spec.buttockHeights; - this.attributes = spec.attributes; //this could/should include LOA, BOA, Depth - this.levelsNeedUpdate = true; - this.style = spec.style || {}; - return this; - - } - - getWeight( designState ) { - - let ha = this.attributes; - let B = ha.BOA; - let D = ha.Depth; - let cp = designState.calculationParameters; - let K = cp.K; - let L = cp.LWL_design; - let T = cp.Draft_design; - let Cb = cp.Cb_design; - let vsm = 0.514444 * cp.speed; // Convert the design speed from knots to m/s - let Fn = vsm / Math.pow( 9.81 * L, 0.5 ); // Calculates Froude number - - //This is not a good way to estimate the hull weight. - let parsons = parametricWeightHull( K, L, B, T, D, Cb, Fn ); - parsons.mass *= 1000; //ad hoc conversion to kg, because the example K value is aimed at ending with tonnes. - - let output = parsons; - //console.info("Hull weight:", output); - return output; - - } - - getStation( x ) { - - let ha = this.attributes; - let xr = x / ha.LOA; - let sts = this.halfBreadths.stations; - let wls = this.halfBreadths.waterlines; - let tab = this.halfBreadths.table; - - let { index: a, mu: mu } = bisectionSearch( sts, xr ); - - let st; - if ( a < 0 || a >= sts.length ) st = new Array( wls.length ).fill( null ); - else if ( a + 1 === sts.length ) st = tab.map( row => row[ sts.length - 1 ] ); - else { - - st = []; - for ( let j = 0; j < wls.length; j ++ ) { - - let after = tab[ j ][ a ]; - let forward = tab[ j ][ a + 1 ]; - if ( ( after === null || isNaN( after ) ) && ( forward === null || isNaN( forward ) ) ) { - - st.push( null ); - - } else { - - //Simply correcting by "|| 0" is not consistent with what is done in getWaterline. It may be better to correct upper nulls by nearest neighbor below. - st.push( lerp( after || 0, forward || 0, mu ) ); - - } - - } - - } - - for ( let j = 0; j < this.halfBreadths.waterlines.length; j ++ ) { - - st[ j ] *= 0.5 * ha.BOA; - if ( isNaN( st[ j ] ) || st[ j ] === null ) st[ j ] = null; - - } - - return st; - - } - - getWaterline( z ) { - - let ha = this.attributes; - let zr = z / ha.Depth; //using zr requires fewer operations and less memory than a scaled copy of wls. - let wls = this.halfBreadths.waterlines;//.map(wl=>wl*ha.Depth); - let sts = this.halfBreadths.stations; - let tab = this.halfBreadths.table; - - if ( zr < wls[ 0 ] ) { - - //console.warn("getWaterLine: z below lowest defined waterline. Defaulting to all zero offsets."); - return new Array( sts.length ).fill( 0 ); - - } else { - - let a, mu; - if ( zr > wls[ wls.length - 1 ] ) { - - //console.warn("getWaterLine: z above highest defined waterline. Proceeding with highest data entries."); - a = wls.length - 2; //if this level is defined... - mu = 1; - //wl = tab[a].slice(); - - } else { - - ( { index: a, mu: mu } = bisectionSearch( wls, zr ) ); - if ( a === wls.length - 1 ) { - - a = wls.length - 2; - mu = 1; - - } - - } - - //Try to do linear interpolation between closest data waterlines, but handle null values well: - let wl = new Array( sts.length ); - for ( let j = 0; j < wl.length; j ++ ) { - - let lower, upper; - let b = a; - //Find lower value for interpolation - if ( tab[ b ][ j ] !== null && ! isNaN( tab[ b ][ j ] ) ) { - - lower = tab[ b ][ j ]; - - } else { - - b = a + 1; - while ( b < wls.length && ( isNaN( tab[ b ][ j ] ) || tab[ b ][ j ] === null ) ) { - - b ++; - - } - - if ( b !== wls.length ) { - - //Inner NaN - lower = 0; - - } else { - - //Upper NaN, search below: - b = a - 1; - while ( b >= 0 && ( isNaN( tab[ b ][ j ] ) || tab[ b ][ j ] === null ) ) { - - b --; - - } - - if ( b === - 1 ) { - - //No number found: - lower = 0; - upper = 0; - - } else { - - lower = tab[ b ][ j ]; - upper = lower; - - } - - } - - } - - //Find upper value for interpolation - let c = a + 1; - if ( upper !== undefined ) ; else if ( tab[ c ][ j ] !== null && ! isNaN( tab[ c ][ j ] ) ) { - - upper = tab[ c ][ j ]; - - } else { - - //The cell value is NaN. - //Upper is not defined. - //That means either tab[a][j] is a number - //or tab[a][j] is an inner NaN and - //there exists at least one number above it. - //In both cases I have to check above a+1. - c = a + 2; - while ( c < wls.length && ( isNaN( tab[ c ][ j ] ) || tab[ c ][ j ] === null ) ) { - - c ++; - - } - - if ( c === wls.length ) upper = lower; - else { - - upper = tab[ c ][ j ]; - - } - - } - - //Linear interpolation - wl[ j ] = lerp( lower, upper, mu ); - //Scale numerical values - if ( wl[ j ] !== null && ! isNaN( wl[ j ] ) ) wl[ j ] *= 0.5 * ha.BOA; - - } - - return wl; - - } - - } - - //typically deck bounds - waterlineCalculation( z, bounds ) { - - let { minX, maxX, minY, maxY } = bounds || {}; - - //console.group/*Collapsed*/("waterlineCalculation."); - //console.info("Arguments: z=", z, " Boundaries: ", arguments[1]); - - let wl = this.getWaterline( z ); - //console.info("wl: ", wl); //DEBUG - - let LOA = this.attributes.LOA; - - let sts = this.halfBreadths.stations.slice(); - for ( let i = 0; i < sts.length; i ++ ) { - - sts[ i ] *= LOA; - - } - - let hasMinX = ( minX !== undefined ) && minX !== sts[ 0 ]; - let hasMaxX = ( maxX !== undefined ) && maxX !== sts[ sts.length - 1 ]; - if ( hasMinX || hasMaxX ) { - - let first = 0; - let wlpre; - if ( hasMinX ) { - - let muf; - ( { index: first, mu: muf } = bisectionSearch( sts, minX ) ); - let lower = wl[ first ]; - let upper = wl[ first + 1 ]; - if ( ( lower === null || isNaN( lower ) ) && ( upper === null || isNaN( upper ) ) ) { - - wlpre = null; - - } else { - - wlpre = lerp( lower || 0, upper || 0, muf ); - - } - - } - - let last = sts.length - 1; - let wlsuff; - if ( hasMaxX ) { - - let mul; - ( { index: last, mu: mul } = bisectionSearch( sts, maxX ) ); - let lower = wl[ last ]; - let upper = wl[ last + 1 ]; - if ( ( lower === null || isNaN( lower ) ) && ( upper === null || isNaN( upper ) ) ) { - - wlsuff = null; - - } else { - - wlsuff = lerp( lower || 0, upper || 0, mul ); - - } - - } - - //Add virtual entries according to specified boundaries: - sts = sts.slice( first + 1, last + 1 ); - wl = wl.slice( first + 1, last + 1 ); - if ( hasMinX ) { - - sts.unshift( minX ); - wl.unshift( wlpre ); - - } - - if ( hasMaxX ) { - - sts.push( maxX ); - wl.push( wlsuff ); - - } - - } - - //This does not yet account properly for undefined minY, maxY. - let port = [], star = []; - for ( let i = 0; i < wl.length; i ++ ) { - - if ( wl[ i ] === null || isNaN( wl[ i ] ) ) { - - star[ i ] = minY || null; - port[ i ] = maxY || null; - - } else { - - star[ i ] = Math.max( - wl[ i ], minY || - wl[ i ] ); - port[ i ] = Math.min( wl[ i ], maxY || wl[ i ] ); - - } - - } - - //DEBUG - //console.info("Arguments to sectionCalculation:", sts, star, port); - - //sectionCalculation can potentially be served some nulls. - let sc = sectionCalculation( { xs: sts, ymins: star, ymaxs: port } ); - let LWL = sc.maxX - sc.minX; - let BWL = sc.maxY - sc.minY; - let Cwp = sc.A / ( LWL * BWL ); - let APP = this.attributes.APP || sc.minX; - let FPP = this.attributes.FPP || sc.maxX; - let LBP = FPP - APP; - - let output = { - z: z, - xc: sc.xc, - yc: sc.yc, - Awp: sc.A, - Ix: sc.Ix, - Iy: sc.Iy, - maxX: sc.maxX, - minX: sc.minX, - maxY: sc.maxY, - minY: sc.minY, - Cwp: Cwp, - LWL: LWL, - LBP: LBP, - BWL: BWL - }; - //console.info("Output from waterlineCalculation: ", output); - //console.groupEnd(); - return output; - - } - - stationCalculation( x, maxZ ) { - - let wls = this.halfBreadths.waterlines.map( wl => this.attributes.Depth * wl ); - let port = this.getStation( x ); - if ( maxZ !== null && ! isNaN( maxZ ) ) { - - let { index, mu } = bisectionSearch( wls, maxZ ); - if ( index < wls.length - 1 ) { - - wls[ index + 1 ] = lerp( wls[ index ], wls[ index + 1 ], mu ); - port[ index + 1 ] = lerp( port[ index ], port[ index + 1 ], mu ); - wls = wls.slice( 0, index + 2 ); - port = port.slice( 0, index + 2 ); - - } - - } - - let star = port.map( hb => - hb ); - - let sc = sectionCalculation( { xs: wls, ymins: star, ymaxs: port } ); - return { - x: x, //or xc? or cg.. Hm. - yc: sc.yc, - zc: sc.xc, - A: sc.A, - Iz: sc.Ix, - Iy: sc.Iy, - maxZ: sc.maxX, - minZ: sc.minX, - maxY: sc.maxY, - minY: sc.minY - }; - - } - - calculateAttributesAtDraft( T ) { - - function levelCalculation( hull, - z, - prev = { - z: 0, - Vs: 0, - Vbb: 0, - As: 0, - minX: 0, - maxX: 0, - minY: 0, - maxY: 0, - prMinY: 0, - prMaxY: 0, - Ap: 0, - Cv: { x: 0, y: 0, z: 0 } - } ) { - - let wlc = hull.waterlineCalculation( z, {} ); - let lev = {}; - Object.assign( lev, wlc ); - //Projected area calculation (approximate): - lev.prMinY = wlc.minY; - lev.prMaxY = wlc.maxY; - //DEBUG: - //console.info("prev.Ap = ", prev.Ap); - //console.info("Parameters to trapezoidCalculation: (%.2f, %.2f, %.2f, %.2f, %.2f, %.2f)", prev.prMinY, prev.prMaxY, lev.prMinY, lev.prMaxY, prev.z, z); - let AT = trapezoidCalculation( prev.prMinY, prev.prMaxY, lev.prMinY, lev.prMaxY, prev.z, z )[ "A" ]; - //console.log("Calculated area of trapezoid: ", AT); - lev.Ap = prev.Ap + AT; - //lev.Ap = prev.Ap - // + trapezoidCalculation(prev.prMinY, prev.prMaxY, lev.prMinY, lev.prMaxY, prev.z, z)["A"]; - //DEBUG END - - - //level bounds are for the bounding box of the submerged part of the hull - if ( wlc.minX !== null && ! isNaN( wlc.minX ) && wlc.minX <= prev.minX ) - lev.minX = wlc.minX; - else - lev.minX = prev.minX; - if ( wlc.maxX !== null && ! isNaN( wlc.maxX ) && wlc.maxX >= prev.maxX ) - lev.maxX = wlc.maxX; - else - lev.maxX = prev.maxX; - if ( wlc.minY !== null && ! isNaN( wlc.minY ) && wlc.minY <= prev.minY ) - lev.minY = wlc.minY; - else - lev.minY = prev.minY; - if ( wlc.maxY !== null && ! isNaN( wlc.maxY ) && wlc.maxY >= prev.maxY ) - lev.maxY = wlc.maxY; - else - lev.maxY = prev.maxY; - - lev.Vbb = ( lev.maxX - lev.minX ) * ( lev.maxY - lev.minY ) * z; - - //Keep level maxX and minX for finding end cap areas: - lev.maxXwp = wlc.maxX; - lev.minXwp = wlc.minX; - - //Find bilinear patches in the slice, and combine them. - //Many possibilities for getting the coordinate systems wrong. - let calculations = []; - let sts = hull.halfBreadths.stations.map( st => st * hull.attributes.LOA ); - let wl = hull.getWaterline( z ); - let prwl = hull.getWaterline( prev.z ); - for ( let j = 0; j < sts.length - 1; j ++ ) { - - let port = - patchColumnCalculation( sts[ j ], sts[ j + 1 ], prev.z, z, - prwl[ j ], - wl[ j ], - prwl[ j + 1 ], - wl[ j + 1 ] ); - calculations.push( port ); - let star = - patchColumnCalculation( sts[ j ], sts[ j + 1 ], prev.z, z, prwl[ j ], wl[ j ], prwl[ j + 1 ], wl[ j + 1 ] ); - calculations.push( star ); - - } - - //console.log(calculations); //DEBUG - let C = combineVolumes( calculations ); - //Cv of slice. Note that switching of yz must - //be done before combining with previous level - let Cv = { x: C.Cv.x, y: C.Cv.z, z: C.Cv.y }; - - lev.Vs = prev.Vs + C.V; //hull volume below z - lev.As = prev.As + C.As; //outside surface below z - - //End caps: - if ( lev.minXwp <= sts[ 0 ] ) - lev.As += hull.stationCalculation( lev.minXwp, z )[ "A" ]; - if ( lev.maxXwp >= sts[ sts.length - 1 ] ) - lev.As += hull.stationCalculation( lev.maxXwp, z )[ "A" ]; - - //center of volume below z (some potential for accumulated rounding error when calculating an accumulated average like this): - lev.Cv = Vectors.scale( Vectors.add( - Vectors.scale( prev.Cv, prev.Vs ), - Vectors.scale( Cv, C.V ) - ), 1 / ( lev.Vs || 2 ) ); - - lev.Cb = lev.Vs / lev.Vbb; - lev.Cp = lev.Vs / ( lev.Ap * ( lev.maxX - lev.minX ) ); - - return lev; - - } - - if ( T === null || isNaN( T ) ) { - - console.error( "Hull.prototype.calculateAttributesAtDraft(T): No draft specified. Returning undefined." ); - return; - - } else if ( T < 0 || T > this.attributes.Depth ) { - - console.error( "Hull.prototype.calculateAttributesAtDraft(T): Draft parameter " + T + "outside valid range of [0,Depth]. Returning undefined." ); - - } - - let wls = this.halfBreadths.waterlines.map( wl => this.attributes.Depth * wl ); - - // new ES6 - //This is the part that can be reused as long as the geometry remains unchanged: - if ( this.levelsNeedUpdate ) { - - this.levels = []; - for ( let i = 0; i < wls.length; i ++ ) { - - let z = wls[ i ]; - let lev = levelCalculation( this, z, this.levels[ i - 1 ] ); - //Bottom cap, only on the lowest level: - if ( i === 0 ) { - - lev.As += lev.Awp; - - } - - this.levels.push( lev ); - - } - - this.levelsNeedUpdate = false; - - } - - //Find highest data waterline below or at water level: - let { index, mu } = bisectionSearch( wls, T ); - - //console.info("Highest data waterline below or at water level: " + index); - //console.log(this.levels); - let lc; - if ( mu === 0 ) lc = this.levels[ index ]; - else lc = levelCalculation( this, T, this.levels[ index ] ); - - //Filter and rename for output - return { - xcwp: lc.xc, //water plane values - LCF: lc.xc, - ycwp: lc.yc, - TCF: lc.yc, - Awp: lc.Awp, - Ixwp: lc.Ix, - BMt: lc.Ix / lc.Vs, - Iywp: lc.Iy, - BMl: lc.Iy / lc.Vs, - maxXs: lc.maxX, //boundaries of the submerged part of the hull - minXs: lc.minX, - maxYs: lc.maxY, - minYs: lc.minY, - Cwp: lc.Cwp, - LWL: lc.LWL, - LBP: lc.LBP, - BWL: lc.BWL, - Ap: lc.Ap, //projected area in length direction - Cp: lc.Cp, //prismatic coefficient - //Vbb: lc.Vbb, - Vs: lc.Vs, //volume of submerged part of the hull - Cb: lc.Cb, - Cm: lc.Cb / lc.Cp, - As: lc.As, //wetted area - Cv: lc.Cv, //center of buoyancy - LCB: lc.Cv.x, - TCB: lc.Cv.y, - KB: lc.Cv.z + //change the trim for angles + trim = Math.atan( trim ) * 180 / Math.PI; + console.log( trimd ); + let heel = w.cg.y / GMt; + //change the hell for meters + heel *= BWL; - }; + return { w, T, GMt, GMl, KB, BMt, BMl, KG, trim, draftfp, draftap, trimd, heel }; - } - // }() + }, + getFuelMass: function ( shipState ) { - //M is the mass (in kg) of the ship - calculateDraftAtMass( M, epsilon = 0.001, rho = 1025 ) { + shipState = shipState || this.designState; - let VT = M / rho; //Target submerged volume (1025=rho_seawater) - //Interpolation: - let a = 0; - let b = this.attributes.Depth; //depth is not draft ¿? - let t = 0.5 * b; - //Souce: https://en.wikipedia.org/wiki/Secant_method - // Secant Method to Find out where is the zero point - // Used to find out the Draft but can be generalized - let V1 = 0 - VT; - let V2 = VT; //Just inserting V2 an ordinary value to not have to calculate it twice - while ( Math.abs( t - a ) > epsilon ) { + let fuelMass = {}; + fuelMass.totalMass = 0; + fuelMass.tankMass = {}; + fuelMass.tankStates = {}; + for ( let o of Object.values( this.derivedObjects ) ) { - //This following condition force just receive draft from [0;Depth] - if ( t > b ) { + if ( o.affiliations.group === "fuel tanks" ) { - t = b; + fuelMass.tankStates[ o.id ] = shipState.getObjectState( o ); + fuelMass.tankMass[ o.id ] = o.baseObject.weightInformation.contentDensity * o.baseObject.weightInformation.volumeCapacity * fuelMass.tankStates[ o.id ].fullness; + fuelMass.totalMass += fuelMass.tankMass[ o.id ]; } - V2 = this.calculateAttributesAtDraft( t )[ "Vs" ] - VT; - // debugger - let dx = ( V2 - V1 ) / ( t - a ); - if ( dx > 0.1 || dx < - 0.1 ) { - - a = t; - V1 = V2; - t = t - V2 / dx; - //In case the derived of function is close to 0 we can follow the Bisection method - //Source: https://en.wikipedia.org/wiki/Bisection_method - - } else { + } - let ts = 0.5 * ( a + t ); //intermediate point - let Vs = this.calculateAttributesAtDraft( ts )[ "Vs" ] - VT; //this values must be calculated twice, see better example - if ( Vs > 0 ) { + return fuelMass; - t = ts; - V2 = Vs; + }, + subtractFuelMass: function ( mass, shipState ) { - } else { + shipState = shipState || this.designState; - a = ts; - V1 = Vs; + var fuelMass = this.getFuelMass( shipState ); + var totalFuel = fuelMass.totalMass; + var tankEntr = Object.entries( fuelMass.tankMass ); - } + var fuelCap = 0; + for ( var tk = 0; tk < tankEntr.length; tk ++ ) { - } + var tkId = tankEntr[ tk ][ 0 ]; + fuelCap += this.derivedObjects[ tkId ].baseObject.weightInformation.volumeCapacity * this.derivedObjects[ tkId ].baseObject.weightInformation.contentDensity; } - return t; + // check if tanks have necessary fuel + if ( mass <= totalFuel ) { // if yes, subtract mass in the same proportion - } + for ( var tk = 0; tk < tankEntr.length; tk ++ ) { - getSpecification() { + var tkId = tankEntr[ tk ][ 0 ]; + shipState.objectCache[ tkId ].state.fullness -= mass / fuelCap; - return { - halfBreadths: this.halfBreadths, - //buttockHeights: this.buttockHeights - attributes: this.attributes, - style: this.style - }; + } - } + } else { // if not, make tanks empty + mass -= totalFuel; + for ( var tk = 0; tk < tankEntr.length; tk ++ ) { + var tkId = tankEntr[ tk ][ 0 ]; + shipState.objectCache[ tkId ].state.fullness = 0; -} + } -//@EliasHasle + console.error( "Vessel ran out of fuel before " + mass.toFixed( 2 ) + " tons were subtracted." ); + } -//Very unoptimized for now. -function combineWeights( array ) { + // update related states. In the future, make this consistent with improved caching system + for ( var prop in shipState.objectCache ) { - let M = array.reduce( ( sum, e ) => sum + e.mass, 0 ); - let cgms = array.map( e => Vectors.scale( e.cg, e.mass ) ); - let CG = Vectors.scale( Vectors.sum( cgms ), 1 / M ); + shipState.objectCache[ prop ].thisStateVer ++; - return { mass: M, cg: CG }; + } -} + shipState.version ++; + } +} ); //@EliasHasle -class Structure extends JSONSpecObject { - - constructor( spec ) { +function Structure( spec/*, ship*/ ) { - //this.ship = ship; - super( spec ); + //this.ship = ship; + JSONSpecObject.call( this, spec ); - } +} - setFromSpecification( spec ) { +Structure.prototype = Object.create( JSONSpecObject.prototype ); +Object.assign( Structure.prototype, { + setFromSpecification: function ( spec ) { this.hull = new Hull( spec.hull/*, this.ship*/ ); this.decks = spec.decks;/*{}; @@ -1589,9 +1043,8 @@ class Structure extends JSONSpecObject { return this; - } - - getSpecification() { + }, + getSpecification: function () { let spec = { hull: this.hull.getSpecification(), @@ -1615,9 +1068,9 @@ class Structure extends JSONSpecObject { return spec; - } - - getWeight( designState ) { + }, + //This is all dummy calculations + getWeight: function ( designState ) { let components = []; //Hull @@ -1667,172 +1120,237 @@ class Structure extends JSONSpecObject { return output; } +} ); +//@EliasHasle + +/*When having a class for this, the specification can possibly be in one of several formats, and the handling will be contained in this class. + +I have tried to remove the dependency on the ship object here. This is in order to be able to optimize updates. + +This class needs more comments, for shure. + +And the geometric calculations are faulty. +*/ + +function Hull( spec ) { + + JSONSpecObject.call( this, spec ); } -//@EliasHasle +Hull.prototype = Object.create( JSONSpecObject.prototype ); +Object.assign( Hull.prototype, { + constructor: Hull, + setFromSpecification: function ( spec ) { + this.halfBreadths = spec.halfBreadths; + //this.buttockHeights = spec.buttockHeights; + this.attributes = spec.attributes; //this could/should include LOA, BOA, Depth + this.levelsNeedUpdate = true; + this.style = spec.style || {}; + return this; -class ShipState extends JSONSpecObject { + }, + getSpecification: function () { - constructor( specification ) { + return { + halfBreadths: this.halfBreadths, + //buttockHeights: this.buttockHeights + attributes: this.attributes, + style: this.style + }; - super( specification ); + }, + //to facilitate economical caching, it may be best to have a few numerical parameters to this function instead of letting it depend on the whole designState. Or maybe the designState is static enough. + getWeight: function ( designState ) { - } + let ha = this.attributes; + let B = ha.BOA; + let D = ha.Depth; + let cp = designState.calculationParameters; + let K = cp.K; + let L = cp.LWL_design; + let T = cp.Draft_design; + let Cb = cp.Cb_design; + let vsm = 0.514444 * cp.speed; // Convert the design speed from knots to m/s + let Fn = vsm / Math.pow( 9.81 * L, 0.5 ); // Calculates Froude number - getSpecification() { + //This is not a good way to estimate the hull weight. + let parsons = parametricWeightHull( K, L, B, T, D, Cb, Fn ); + parsons.mass *= 1000; //ad hoc conversion to kg, because the example K value is aimed at ending with tonnes. - if ( this.cachedVersion !== this.version ) { + let output = parsons; + //console.info("Hull weight:", output); + return output; - var spec = { - calculationParameters: this.calculationParameters, - objectOverrides: this.objectOverrides//{} - }; + }, + /* + Testing new version without nanCorrectionMode parameter, that defaults to setting lower NaNs to 0 and extrapolating highest data entry for upper NaNs (if existant, else set to 0). Inner NaNs will also be set to zero. - //Sketchy, but versatile: - spec = JSON.parse( JSON.stringify( spec ) ); + Input: + z: level from bottom of ship (absolute value in meters) - this.specCache = spec; - this.cachedVersion = this.version; + Output: + Array representing waterline offsets for a given height from the keel (typically a draft). + */ + getWaterline: function ( z ) { - } + let ha = this.attributes; + let zr = z / ha.Depth; //using zr requires fewer operations and less memory than a scaled copy of wls. + let wls = this.halfBreadths.waterlines;//.map(wl=>wl*ha.Depth); + let sts = this.halfBreadths.stations; + let tab = this.halfBreadths.table; - return this.specCache; + if ( zr < wls[ 0 ] ) { - } + //console.warn("getWaterLine: z below lowest defined waterline. Defaulting to all zero offsets."); + return new Array( sts.length ).fill( 0 ); - clone() { + } else { - return new ShipState( this.getSpecification() ); + let a, mu; + if ( zr > wls[ wls.length - 1 ] ) { - } + //console.warn("getWaterLine: z above highest defined waterline. Proceeding with highest data entries."); + a = wls.length - 2; //if this level is defined... + mu = 1; + //wl = tab[a].slice(); - getObjectState( o ) { + } else { - if ( this.objectCache[ o.id ] !== undefined ) { + ( { index: a, mu: mu } = bisectionSearch( wls, zr ) ); + if ( a === wls.length - 1 ) { - let c = this.objectCache[ o.id ]; - if ( c.thisStateVer === this.version - /*&& c.baseStateVer === o.baseObject.baseStateVersion - && c.refStateVer === o.referenceStateVersion*/ ) { + a = wls.length - 2; + mu = 1; - console.log( "ShipState.getObjectState: Using cache." ); - return c.state; + } } - } + //Try to do linear interpolation between closest data waterlines, but handle null values well: + let wl = new Array( sts.length ); + for ( let j = 0; j < wl.length; j ++ ) { - console.log( "ShipState.getObjectState: Not using cache." ); + let lower, upper; + let b = a; + //Find lower value for interpolation + if ( tab[ b ][ j ] !== null && ! isNaN( tab[ b ][ j ] ) ) { - let state = {}; - Object.assign( state, o.baseObject.baseState ); - Object.assign( state, o.referenceState ); - let oo = this.objectOverrides; - let sources = [ oo.common, oo.baseByID[ o.baseObject.id ], oo.derivedByGroup[ o.affiliations.group ], oo.derivedByID[ o.id ] ]; - for ( let i = 0; i < sources.length; i ++ ) { + lower = tab[ b ][ j ]; - let s = sources[ i ]; - if ( ! s ) continue; - let sk = Object.keys( s ); - for ( let k of sk ) { + } else { - //Override existing properties only: - if ( state[ k ] !== undefined ) { + b = a + 1; + while ( b < wls.length && ( isNaN( tab[ b ][ j ] ) || tab[ b ][ j ] === null ) ) { - state[ k ] = s[ k ]; + b ++; - } + } - } + if ( b !== wls.length ) { - } + //Inner NaN + lower = 0; - this.objectCache[ o.id ] = { - thisStateVer: this.version, - /*baseStateVer: o.baseObject.baseStateVersion, - refStateVer: o.referenceStateVersion,*/ - state: state - }; + } else { + + //Upper NaN, search below: + b = a - 1; + while ( b >= 0 && ( isNaN( tab[ b ][ j ] ) || tab[ b ][ j ] === null ) ) { + + b --; + + } + + if ( b === - 1 ) { + + //No number found: + lower = 0; + upper = 0; + + } else { + + lower = tab[ b ][ j ]; + upper = lower; + + } + + } + + } + + //Find upper value for interpolation + let c = a + 1; + if ( upper !== undefined ) { /*upper found above*/ } else if ( tab[ c ][ j ] !== null && ! isNaN( tab[ c ][ j ] ) ) { - return state; + upper = tab[ c ][ j ]; - } + } else { - //o is an object, k is a key to a single state property - getObjectStateProperty( o, k ) { + //The cell value is NaN. + //Upper is not defined. + //That means either tab[a][j] is a number + //or tab[a][j] is an inner NaN and + //there exists at least one number above it. + //In both cases I have to check above a+1. + c = a + 2; + while ( c < wls.length && ( isNaN( tab[ c ][ j ] ) || tab[ c ][ j ] === null ) ) { - return this.getObjectState( o )[ k ]; - //I have commented out a compact, but not very efficient, implementation of Alejandro's pattern, that does not fit too well with my caching solution. - /* let oo = this.objectOverrides; - let sources = [oo.derivedByID[o.id], oo.derivedByGroup[o.affiliations.group], oo.baseByID[o.baseObject.id], oo.common, o.getReferenceState(), o.baseObject.getBaseState()].filter(e=>!!e); - for (let i = 0; i < sources.length; i++) { - if (sources[i][k] !== undefined) return sources[i][k]; - } - return; //undefined*/ + c ++; - } + } - setFromSpecification( spec ) { + if ( c === wls.length ) upper = lower; + else { - this.setInitialState(); + upper = tab[ c ][ j ]; - this.objectCache = {}; //reset cache - if ( ! spec ) { + } - Object.assign( this, { - calculationParameters: {}, - //Named overrides because only existing corresponding properties will be set - objectOverrides: { - commmon: {}, - //baseByGroup: {}, - baseByID: {}, - derivedByGroup: {}, - derivedByID: {} } - } ); - return; - } + //Linear interpolation + wl[ j ] = lerp( lower, upper, mu ); + //Scale numerical values + if ( wl[ j ] !== null && ! isNaN( wl[ j ] ) ) wl[ j ] *= 0.5 * ha.BOA; - this.calculationParameters = spec.calculationParameters || {}; - this.objectOverrides = {}; - let oo = this.objectOverrides; - let soo = spec.objectOverrides || {}; - oo.common = soo.common || {}; - oo.baseByID = soo.baseByID || {}; - oo.derivedByGroup = soo.derivedByGroup || {}; - oo.derivedByID = soo.derivedByID || {}; + } - this.version ++; + return wl; - return this; + } - } + }, + //This must be debugged more. getWaterline got an overhaul, but this did not. + getStation: function ( x ) { + + let ha = this.attributes; + let xr = x / ha.LOA; + let sts = this.halfBreadths.stations; + let wls = this.halfBreadths.waterlines; + let tab = this.halfBreadths.table; - extend( spec ) { + let { index: a, mu: mu } = bisectionSearch( sts, xr ); - Object.assign( this.calculationParameters, spec.calculationParameters ); - this.calculatedProperties = {}; - let oo = this.objectOverrides; - let soo = spec.objectOverrides || {}; - Object.assign( oo.common, soo.common ); - let sources = [ soo.baseByID, soo.derivedByGroup, soo.derivedByID ]; - let targets = [ oo.baseByID, oo.derivedByGroup, oo.derivedByID ]; - for ( let i = 0; i < sources.length; i ++ ) { + let st; + if ( a < 0 || a >= sts.length ) st = new Array( wls.length ).fill( null ); + else if ( a + 1 === sts.length ) st = tab.map( row => row[ sts.length - 1 ] ); + else { - if ( ! sources[ i ] ) continue; - let sk = Object.keys( sources[ i ] ); - for ( let k of sk ) { + st = []; + for ( let j = 0; j < wls.length; j ++ ) { - if ( targets[ i ][ k ] !== undefined ) { + let after = tab[ j ][ a ]; + let forward = tab[ j ][ a + 1 ]; + if ( ( after === null || isNaN( after ) ) && ( forward === null || isNaN( forward ) ) ) { - Object.assign( targets[ i ][ k ], sources[ i ][ k ] ); + st.push( null ); } else { - targets[ i ][ k ] = sources[ i ][ k ]; + //Simply correcting by "|| 0" is not consistent with what is done in getWaterline. It may be better to correct upper nulls by nearest neighbor below. + st.push( lerp( after || 0, forward || 0, mu ) ); } @@ -1840,601 +1358,888 @@ class ShipState extends JSONSpecObject { } - this.version ++; + for ( let j = 0; j < this.halfBreadths.waterlines.length; j ++ ) { - } - //Applies only directives of spec that have a corresponding directive in this. - override( spec ) { + st[ j ] *= 0.5 * ha.BOA; + if ( isNaN( st[ j ] ) || st[ j ] === null ) st[ j ] = null; - let oo = this.objectOverrides; - let soo = spec.objectOverrides; + } - let sources = [ spec.calculationParameters, soo.common ]; - let targets = [ this.calculationParameters, oo.common ]; - for ( let i = 0; i < sources.length; i ++ ) { + return st; - if ( ! sources[ i ] ) continue; - let sk = Object.keys( sources[ i ] ); - for ( let k of sk ) { + }, + //typically deck bounds + waterlineCalculation: function ( z, bounds ) { - if ( targets[ i ][ k ] !== undefined ) { + let { minX, maxX, minY, maxY } = bounds || {}; - targets[ i ][ k ] = sources[ i ][ k ]; + //console.group/*Collapsed*/("waterlineCalculation."); + //console.info("Arguments: z=", z, " Boundaries: ", arguments[1]); - } + let wl = this.getWaterline( z ); + //console.info("wl: ", wl); //DEBUG - } + let LOA = this.attributes.LOA; + + let sts = this.halfBreadths.stations.slice(); + for ( let i = 0; i < sts.length; i ++ ) { + + sts[ i ] *= LOA; } - sources = [ soo.common, soo.baseByID, soo.derivedByGroup, soo.derivedByID ]; - targets = [ oo.common, oo.baseByID, oo.derivedByGroup, oo.derivedByID ]; + let hasMinX = ( minX !== undefined ) && minX !== sts[ 0 ]; + let hasMaxX = ( maxX !== undefined ) && maxX !== sts[ sts.length - 1 ]; + if ( hasMinX || hasMaxX ) { - for ( let i = 0; i < sources.length; i ++ ) { + let first = 0; + let wlpre; + if ( hasMinX ) { - if ( ! sources[ i ] ) continue; - let specKeys = Object.keys( sources[ i ] ); - for ( let key of specKeys ) { + let muf; + ( { index: first, mu: muf } = bisectionSearch( sts, minX ) ); + let lower = wl[ first ]; + let upper = wl[ first + 1 ]; + if ( ( lower === null || isNaN( lower ) ) && ( upper === null || isNaN( upper ) ) ) { - if ( targets[ i ][ key ] !== undefined ) { + wlpre = null; - let t = targets[ i ][ key ]; - let s = sources[ i ][ key ]; - if ( ! s ) continue; - let sk = Object.keys( s ); - //Loop over individual properties in assignments, and override only: - for ( let k of sk ) { + } else { - if ( t[ k ] !== undefined ) { + wlpre = lerp( lower || 0, upper || 0, muf ); - t[ k ] = s[ k ]; + } - } + } - } + let last = sts.length - 1; + let wlsuff; + if ( hasMaxX ) { + + let mul; + ( { index: last, mu: mul } = bisectionSearch( sts, maxX ) ); + let lower = wl[ last ]; + let upper = wl[ last + 1 ]; + if ( ( lower === null || isNaN( lower ) ) && ( upper === null || isNaN( upper ) ) ) { + + wlsuff = null; + + } else { + + wlsuff = lerp( lower || 0, upper || 0, mul ); } } - } + //Add virtual entries according to specified boundaries: + sts = sts.slice( first + 1, last + 1 ); + wl = wl.slice( first + 1, last + 1 ); + if ( hasMinX ) { - this.version ++; + sts.unshift( minX ); + wl.unshift( wlpre ); - } + } - setInitialState() { + if ( hasMaxX ) { - this.version = 0; - this.objectCache = {}; - this.continuous = {}; - this.discrete = {}; + sts.push( maxX ); + wl.push( wlsuff ); - } + } -} + } -//@EliasHasle + //This does not yet account properly for undefined minY, maxY. + let port = [], star = []; + for ( let i = 0; i < wl.length; i ++ ) { + if ( wl[ i ] === null || isNaN( wl[ i ] ) ) { -function loadShip( url, callback ) { + star[ i ] = minY || null; + port[ i ] = maxY || null; - // Use the common function for loading data via XMLHttpRequest - loadXMLHttpRequest( url, function ( specification ) { + } else { - let ship = new Ship( specification ); - callback( ship ); + star[ i ] = Math.max( - wl[ i ], minY || - wl[ i ] ); + port[ i ] = Math.min( wl[ i ], maxY || wl[ i ] ); - } ); + } -} + } + //DEBUG + //console.info("Arguments to sectionCalculation:", sts, star, port); -function loadXMLHttpRequest( url, callback, asyncMethod = true ) { + //sectionCalculation can potentially be served some nulls. + let sc = sectionCalculation( { xs: sts, ymins: star, ymaxs: port } ); + let LWL = sc.maxX - sc.minX; + let BWL = sc.maxY - sc.minY; + let Cwp = sc.A / ( LWL * BWL ); + let APP = this.attributes.APP || sc.minX; + let FPP = this.attributes.FPP || sc.maxX; + let LBP = FPP - APP; - let request = new XMLHttpRequest(); - request.open( "GET", url, asyncMethod ); - request.addEventListener( "load", function ( event ) { + let output = { + z: z, + xc: sc.xc, + yc: sc.yc, + Awp: sc.A, + Ix: sc.Ix, + Iy: sc.Iy, + maxX: sc.maxX, + minX: sc.minX, + maxY: sc.maxY, + minY: sc.minY, + Cwp: Cwp, + LWL: LWL, + LBP: LBP, + BWL: BWL + }; + //console.info("Output from waterlineCalculation: ", output); + //console.groupEnd(); + return output; - if ( request.status === 200 ) { + }, + //Not done, and not tested + //The optional maxZ parameter is introduced for enabling below-water calculations. More bounds will add more complexity, although then some common logic may perhaps be moved from this method and waterlineCalculation to sectionCalculation. + stationCalculation: function ( x, maxZ ) { + + let wls = this.halfBreadths.waterlines.map( wl => this.attributes.Depth * wl ); + let port = this.getStation( x ); + if ( maxZ !== null && ! isNaN( maxZ ) ) { - let response = event.target.response; - var specification = JSON.parse( response ); - callback( specification ); + let { index, mu } = bisectionSearch( wls, maxZ ); + if ( index < wls.length - 1 ) { - } else { + wls[ index + 1 ] = lerp( wls[ index ], wls[ index + 1 ], mu ); + port[ index + 1 ] = lerp( port[ index ], port[ index + 1 ], mu ); + wls = wls.slice( 0, index + 2 ); + port = port.slice( 0, index + 2 ); - console.error( "Error loading data from: " + url ); + } } - } ); - request.send( null ); - -} + let star = port.map( hb => - hb ); -//@EliasHasle -//@ferrari212 + let sc = sectionCalculation( { xs: wls, ymins: star, ymaxs: port } ); + return { + x: x, //or xc? or cg.. Hm. + yc: sc.yc, + zc: sc.xc, + A: sc.A, + Iz: sc.Ix, + Iy: sc.Iy, + maxZ: sc.maxX, + minZ: sc.minX, + maxY: sc.maxY, + minY: sc.minY + }; + }, -class Ship extends JSONSpecObject { + /* + Known issues: + nulls in the offset table will be corrected to numbers in this calculation, whereas the intended meaning of a null supposedly is that there is no hull at that position. This means the calculation can overestimate the wetted area (and possibly make other errors too). + */ + //Important: calculateAttributesAtDraft takes one mandatory parameter T. (The function defined here is immediately called during construction of the prototype, and returns the proper function.) + calculateAttributesAtDraft: function () { - constructor( specification ) { + function levelCalculation( hull, + z, + prev = { + z: 0, + Vs: 0, + Vbb: 0, + As: 0, + minX: 0, + maxX: 0, + minY: 0, + maxY: 0, + prMinY: 0, + prMaxY: 0, + Ap: 0, + Cv: { x: 0, y: 0, z: 0 } + } ) { - // Check if the Specification is a string pointing - // to a JSON file. In case of positive answer, load - // the file and parse it to JSON + let wlc = hull.waterlineCalculation( z, {} ); + let lev = {}; + Object.assign( lev, wlc ); + //Projected area calculation (approximate): + lev.prMinY = wlc.minY; + lev.prMaxY = wlc.maxY; + //DEBUG: + //console.info("prev.Ap = ", prev.Ap); + //console.info("Parameters to trapezoidCalculation: (%.2f, %.2f, %.2f, %.2f, %.2f, %.2f)", prev.prMinY, prev.prMaxY, lev.prMinY, lev.prMaxY, prev.z, z); + let AT = trapezoidCalculation( prev.prMinY, prev.prMaxY, lev.prMinY, lev.prMaxY, prev.z, z )[ "A" ]; + //console.log("Calculated area of trapezoid: ", AT); + lev.Ap = prev.Ap + AT; + //lev.Ap = prev.Ap + // + trapezoidCalculation(prev.prMinY, prev.prMaxY, lev.prMinY, lev.prMaxY, prev.z, z)["A"]; + //DEBUG END - // Warning: this uses an async function for XMLHttpRequest - // this function is deprecated and it is not recommended for - // slow connections. Its purpose is to ease the usability - // of the library without having to import the loader in the main script. - // For further information on synchronous request, please read: - // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests#synchronous_request - // @ferrari212 - if ( typeof specification === "string" ) { - loadXMLHttpRequest( specification, function ( parsedJSON ) { + //level bounds are for the bounding box of the submerged part of the hull + if ( wlc.minX !== null && ! isNaN( wlc.minX ) && wlc.minX <= prev.minX ) + lev.minX = wlc.minX; + else + lev.minX = prev.minX; + if ( wlc.maxX !== null && ! isNaN( wlc.maxX ) && wlc.maxX >= prev.maxX ) + lev.maxX = wlc.maxX; + else + lev.maxX = prev.maxX; + if ( wlc.minY !== null && ! isNaN( wlc.minY ) && wlc.minY <= prev.minY ) + lev.minY = wlc.minY; + else + lev.minY = prev.minY; + if ( wlc.maxY !== null && ! isNaN( wlc.maxY ) && wlc.maxY >= prev.maxY ) + lev.maxY = wlc.maxY; + else + lev.maxY = prev.maxY; - specification = parsedJSON; + lev.Vbb = ( lev.maxX - lev.minX ) * ( lev.maxY - lev.minY ) * z; - }, false ); + //Keep level maxX and minX for finding end cap areas: + lev.maxXwp = wlc.maxX; + lev.minXwp = wlc.minX; - } + //Find bilinear patches in the slice, and combine them. + //Many possibilities for getting the coordinate systems wrong. + let calculations = []; + let sts = hull.halfBreadths.stations.map( st => st * hull.attributes.LOA ); + let wl = hull.getWaterline( z ); + let prwl = hull.getWaterline( prev.z ); + for ( let j = 0; j < sts.length - 1; j ++ ) { + let port = + patchColumnCalculation( sts[ j ], sts[ j + 1 ], prev.z, z, - prwl[ j ], - wl[ j ], - prwl[ j + 1 ], - wl[ j + 1 ] ); + calculations.push( port ); + let star = + patchColumnCalculation( sts[ j ], sts[ j + 1 ], prev.z, z, prwl[ j ], wl[ j ], prwl[ j + 1 ], wl[ j + 1 ] ); + calculations.push( star ); - super( specification ); + } - } + //console.log(calculations); //DEBUG + let C = combineVolumes( calculations ); + //Cv of slice. Note that switching of yz must + //be done before combining with previous level + let Cv = { x: C.Cv.x, y: C.Cv.z, z: C.Cv.y }; - createShip3D( specs, Ship3D ) { + lev.Vs = prev.Vs + C.V; //hull volume below z + lev.As = prev.As + C.As; //outside surface below z + //End caps: + if ( lev.minXwp <= sts[ 0 ] ) + lev.As += hull.stationCalculation( lev.minXwp, z )[ "A" ]; + if ( lev.maxXwp >= sts[ sts.length - 1 ] ) + lev.As += hull.stationCalculation( lev.maxXwp, z )[ "A" ]; - const state = this.designState; - try { + //center of volume below z (some potential for accumulated rounding error when calculating an accumulated average like this): + lev.Cv = Vectors.scale( Vectors.add( + Vectors.scale( prev.Cv, prev.Vs ), + Vectors.scale( Cv, C.V ) + ), 1 / ( lev.Vs || 2 ) ); - // Initialize the - this.ship3D = new Ship3D( this, Object.assign( { - shipState: state, - }, specs ) - ); + lev.Cb = lev.Vs / lev.Vbb; + lev.Cp = lev.Vs / ( lev.Ap * ( lev.maxX - lev.minX ) ); - } catch ( error ) { + return lev; - const error_string = "Ship3D is not a constructor"; + } - if ( error.message.includes( error_string ) ) { + //Here is the returned function calculateAttributesAtDraft(T): + return function ( T ) { - const error_reason = "The Ship3D function passed as argument is in a wrong format"; - const error_solution = "Please, verify if the argument was imported correctly on the parent function: import { Ship3D } from 'path/to/file'"; + if ( T === null || isNaN( T ) ) { - console.error( `${error_reason}: ${error.message}. ${error_solution}` ); + console.error( "Hull.prototype.calculateAttributesAtDraft(T): No draft specified. Returning undefined." ); + return; - } else { + } else if ( T < 0 || T > this.attributes.Depth ) { - console.error( error ); + console.error( "Hull.prototype.calculateAttributesAtDraft(T): Draft parameter " + T + "outside valid range of [0,Depth]. Returning undefined." ); } - } + let wls = this.halfBreadths.waterlines.map( wl => this.attributes.Depth * wl ); + //This is the part that can be reused as long as the geometry remains unchanged: + if ( this.levelsNeedUpdate ) { - } + this.levels = []; + for ( let i = 0; i < wls.length; i ++ ) { - calculateDraft( shipState, epsilon = 0.001, rho = 1025 ) { + let z = wls[ i ]; + let lev = levelCalculation( this, z, this.levels[ i - 1 ] ); + //Bottom cap, only on the lowest level: + if ( i === 0 ) { - let w = this.getWeight( shipState ); - let M = w.mass; - return this.structure.hull.calculateDraftAtMass( M, epsilon, rho ); + lev.As += lev.Awp; - } + } - calculateStability( shipState ) { + this.levels.push( lev ); - let w = this.getWeight( shipState ); - let KG = w.cg.z; - let LCG = w.cg.x; - let T = this.structure.hull.calculateDraftAtMass( w.mass ); - let { BMt, BMl, KB, LCB, LCF, LWL, BWL } = this.structure.hull.calculateAttributesAtDraft( T ); - let GMt = KB + BMt - KG; - let GMl = KB + BMl - KG; + } - // avaiable just for small angles < 3° - // this calculation can be incorporated to Vessesl.js with no problem - let trim = ( LCB - LCG ) / GMl; - let draftfp = 0; - let draftap = 0; - let trimd = 0; + this.levelsNeedUpdate = false; - if ( trim < Math.tan( 3 * Math.PI / 180 ) ) { + } - draftfp = T - ( LWL - LCF ) * trim; - draftap = T + ( LCF ) * trim; - trimd = draftfp - draftap; + //Find highest data waterline below or at water level: + let { index, mu } = bisectionSearch( wls, T ); + + //console.info("Highest data waterline below or at water level: " + index); + //console.log(this.levels); + let lc; + if ( mu === 0 ) lc = this.levels[ index ]; + else lc = levelCalculation( this, T, this.levels[ index ] ); + + //Filter and rename for output + return { + xcwp: lc.xc, //water plane values + LCF: lc.xc, + ycwp: lc.yc, + TCF: lc.yc, + Awp: lc.Awp, + Ixwp: lc.Ix, + BMt: lc.Ix / lc.Vs, + Iywp: lc.Iy, + BMl: lc.Iy / lc.Vs, + maxXs: lc.maxX, //boundaries of the submerged part of the hull + minXs: lc.minX, + maxYs: lc.maxY, + minYs: lc.minY, + Cwp: lc.Cwp, + LWL: lc.LWL, + LBP: lc.LBP, + BWL: lc.BWL, + Ap: lc.Ap, //projected area in length direction + Cp: lc.Cp, //prismatic coefficient + //Vbb: lc.Vbb, + Vs: lc.Vs, //volume of submerged part of the hull + Cb: lc.Cb, + Cm: lc.Cb / lc.Cp, + As: lc.As, //wetted area + Cv: lc.Cv, //center of buoyancy + LCB: lc.Cv.x, + TCB: lc.Cv.y, + KB: lc.Cv.z + }; - } else { + }; - draftfp = null; - draftap = null; - trimd = null; + }(), + //M is the mass (in kg) of the ship + calculateDraftAtMass: function ( M, epsilon = 0.001, rho = 1025 ) { - } + let VT = M / rho; //Target submerged volume (1025=rho_seawater) + //Interpolation: + let a = 0; + let b = this.attributes.Depth; //depth is not draft ¿? + let t = 0.5 * b; + //Souce: https://en.wikipedia.org/wiki/Secant_method + // Secant Method to Find out where is the zero point + // Used to find out the Draft but can be generalized + let V1 = 0 - VT; + let V2 = VT; //Just inserting V2 an ordinary value to not have to calculate it twice + let n = 0; + while ( Math.abs( t - a ) > epsilon ) { - //change the trim for angles - trim = Math.atan( trim ) * 180 / Math.PI; - console.log( trimd ); + //This following condition force just receive draft from [0;Depth] + if ( t > b ) { - let heel = w.cg.y / GMt; - //change the hell for meters - heel *= BWL; + t = b; - return { w, T, GMt, GMl, KB, BMt, BMl, KG, trim, draftfp, draftap, trimd, heel }; + } - } + V2 = this.calculateAttributesAtDraft( t )[ "Vs" ] - VT; + // debugger + let dx = ( V2 - V1 ) / ( t - a ); + if ( dx > 0.1 || dx < - 0.1 ) { - getFuelMass( shipState ) { + a = t; + V1 = V2; + t = t - V2 / dx; + //In case the derived of function is close to 0 we can follow the Bisection method + //Source: https://en.wikipedia.org/wiki/Bisection_method - shipState = shipState || this.designState; + } else { - let fuelMass = {}; - fuelMass.totalMass = 0; - fuelMass.tankMass = {}; - fuelMass.tankStates = {}; - for ( let o of Object.values( this.derivedObjects ) ) { + let ts = 0.5 * ( a + t ); //intermediate point + let Vs = this.calculateAttributesAtDraft( ts )[ "Vs" ] - VT; //this values must be calculated twice, see better example + if ( Vs > 0 ) { - if ( o.affiliations.group === "fuel tanks" ) { + t = ts; + V2 = Vs; - fuelMass.tankStates[ o.id ] = shipState.getObjectState( o ); - fuelMass.tankMass[ o.id ] = o.baseObject.weightInformation.contentDensity * o.baseObject.weightInformation.volumeCapacity * fuelMass.tankStates[ o.id ].fullness; - fuelMass.totalMass += fuelMass.tankMass[ o.id ]; + } else { + + a = ts; + V1 = Vs; + + } } } - return fuelMass; + return t; } +} ); +//@EliasHasle +//@EliasHasle - subtractFuelMass( mass, shipState ) { +/* +Depends on JSONSpecObject.js +*/ - shipState = shipState || this.designState; +function BaseObject( specification ) { - var fuelMass = this.getFuelMass( shipState ); - var totalFuel = fuelMass.totalMass; - var tankEntr = Object.entries( fuelMass.tankMass ); + this.weightCache = {}; + JSONSpecObject.call( this, specification ); - var fuelCap = 0; - for ( var tk = 0; tk < tankEntr.length; tk ++ ) { +} - var tkId = tankEntr[ tk ][ 0 ]; - fuelCap += this.derivedObjects[ tkId ].baseObject.weightInformation.volumeCapacity * this.derivedObjects[ tkId ].baseObject.weightInformation.contentDensity; +BaseObject.prototype = Object.create( JSONSpecObject.prototype ); +Object.assign( BaseObject.prototype, { + constructor: BaseObject, + setFromSpecification: function ( spec ) { - } + this.id = spec.id; + this.affiliations = spec.affiliations || {}; + this.boxDimensions = spec.boxDimensions || { length: undefined, width: undefined, height: undefined }; + this.weightInformation = spec.weightInformation; + this.cost = spec.cost || { currency: undefined, value: undefined }; + this.capabilities = spec.capabilities || {}; + this.file3D = spec.file3D; + this.baseState = spec.baseState; + return this; - // check if tanks have necessary fuel - if ( mass <= totalFuel ) { // if yes, subtract mass in the same proportion + }, + getSpecification: function () { - for ( var tk = 0; tk < tankEntr.length; tk ++ ) { + return { + id: this.id, + affiliations: this.affiliations, + boxDimensions: this.boxDimensions, + weightInformation: this.weightInformation, + cost: this.cost, + capabilities: this.capabilities, + file3D: this.file3D, + baseState: this.baseState + }; - var tkId = tankEntr[ tk ][ 0 ]; - shipState.objectCache[ tkId ].state.fullness -= mass / fuelCap; + }, + //Maybe this will take more state parameters than just fullness. + getWeight: function ( fullness ) { - } + fullness = fullness || 0; - } else { // if not, make tanks empty + let wi = this.weightInformation; + //Should maybe have been this.capabilities.weightInformation? - mass -= totalFuel; - for ( var tk = 0; tk < tankEntr.length; tk ++ ) { + //(Fluid) container properties default to no content: + let d = wi.contentDensity || 0; + let v = wi.volumeCapacity || 0; + //Maybe we should have another handling of cargo (with variable density) + + let m = wi.lightweight + d * v * fullness; + let cg; + if ( wi.fullnessCGMapping !== undefined ) { + + let fcgm = wi.fullnessCGMapping; + let fs = fcgm.fullnesses; + let cgs = fcgm.cgs; + //Find closest entries: + let { index: i, mu: mu } = bisectionSearch( fs, fullness ); + cg = []; + for ( let j = 0; j < 3; j ++ ) { - var tkId = tankEntr[ tk ][ 0 ]; - shipState.objectCache[ tkId ].state.fullness = 0; + let c; + if ( i < fs.length - 1 ) + //Linear interpolation between closest entries: + c = lerp( cgs[ i ][ j ], cgs[ i + 1 ][ j ], mu ); + else c = cgs[ i ][ j ]; + //if (c===null || isNaN(c)) console.error("BaseObject.getWeight: Invalid value found after interpolation."); + cg.push( c ); } - console.error( "Vessel ran out of fuel before " + mass.toFixed( 2 ) + " tons were subtracted." ); + } else if ( wi.cg !== undefined ) { - } + //console.log("BaseObject.getWeight: Using specified cg."); + cg = wi.cg; - // update related states. In the future, make this consistent with improved caching system - for ( var prop in shipState.objectCache ) { + } else { - shipState.objectCache[ prop ].thisStateVer ++; + console.warn( "BaseObject.getWeight: No cg or fullnessCGMapping supplied. Defaults to center of bounding box." ); + cg = [ 0, 0, 0.5 * this.boxDimensions.height ]; } - shipState.version ++; + let w = { mass: m, cg: { x: cg[ 0 ], y: cg[ 1 ], z: cg[ 2 ] } }; + return w; } +} ); +//@EliasHasle - setFromSpecification( specification ) { - - - this.attributes = specification.attributes || {}; - this.structure = new Structure( specification.structure/*,this*/ ); - //baseObjects and derivedObjects are arrays in the specification, but are objects (hashmaps) in the constructed ship object: - this.baseObjects = {}; - for ( let i = 0; i < specification.baseObjects.length; i ++ ) { +/* +Depends on JSONSpecObject.js +*/ - let os = specification.baseObjects[ i ]; - this.baseObjects[ os.id ] = new BaseObject( os ); +function DerivedObject( specification, baseObjects ) { - } + this.baseObjects = baseObjects; + JSONSpecObject.call( this, specification ); - this.derivedObjects = {}; - for ( let i = 0; i < specification.derivedObjects.length; i ++ ) { +} - let os = specification.derivedObjects[ i ]; - this.derivedObjects[ os.id ] = new DerivedObject( os, this.baseObjects ); +DerivedObject.prototype = Object.create( JSONSpecObject.prototype ); +Object.assign( DerivedObject.prototype, { + constructor: DerivedObject, + setFromSpecification: function ( spec ) { - } + this.id = spec.id; + this.group = spec.group || null; + this.affiliations = spec.affiliations; + if ( typeof spec.baseObject === "string" ) { - this.designState = new ShipState( specification.designState ); - return this; + this.baseObject = this.baseObjects[ spec.baseObject ]; + } else { - } + this.baseObject = new BaseObject( spec.baseObject ); - getSpecification() { + } - let specification = {}; - specification.attributes = this.attributes; - specification.structure = this.structure.getSpecification(); + this.referenceState = spec.referenceState; + //this.referenceStateVersion = 0; + this.style = spec.style || {}; + return this; - specification.baseObjects = Object.values( this.baseObjects ).map( o => o.getSpecification() ); - specification.derivedObjects = Object.values( this.derivedObjects ).map( o => o.getSpecification() ); + }, + getSpecification: function () { - specification.designState = this.designState.getSpecification(); + let spec = { + id: this.id, + group: this.group, + affiliations: this.affiliations, + referenceState: this.referenceState, + style: this.style + }; + if ( this.baseObjects[ this.baseObject.id ] !== undefined ) { - return specification; + spec.baseObject = this.baseObject.id; - } + } else { - getWeight( shipState ) { + spec.baseObject = this.baseObject.getSpecification(); - shipState = shipState || this.designState; + } - // Comment: This piece of code maybe must be deleted - // this.structure = new Structure( specification.structure/*,this*/ ); + return spec; - let components = []; + }, + getWeight: function ( state ) { - components.push( - this.structure.getWeight( this.designState ) - ); + let oState = state.getObjectState( this ); - for ( let o of Object.values( this.derivedObjects ) ) { + //Support disabled objects: + if ( oState.exists === false ) { - components.push( o.getWeight( shipState ) ); + return { mass: 0, cg: { x: 0, y: 0, z: 0 } }; } - var W = combineWeights( components ); - //console.info("Calculated weight object: ", W); - return W; - - } + let p = { + x: oState.xCentre, + y: oState.yCentre, + z: oState.zBase + }; - // This function is for sanity checking if objects states and id are compatible - validateObjectBond( objects, id ) { + let w = this.baseObject.getWeight( oState.fullness ); + let m = w.mass; + let cg = Vectors.add( p, w.cg ); - if ( typeof id !== "string" || objects[ id ] === undefined ) { + if ( isNaN( cg.x + cg.y + cg.z ) ) { - console.error( "Undefined bond with ID '" + id + "' in the object" ); - throw new Error( "validateObjectBond: object bond modification not valid" ); + console.error( "DerivedObject.getWeight: returning NaN values." ); } - } - - changeObject( object, spec ) { - - if ( typeof object !== "object" ) { + return { mass: m, cg: cg }; - console.error( "changeObject: object must be an object." ); - return; + } +} ); +//@EliasHasle - } +/* +The object state assignments could/should also have a baseByGroup. A group of baseObjects could for instance be a category including all tanks that carry a given compound, regardless of their size and shape. Maybe "group" is not a good name for something that can be set freely. Maybe "label" or "tag" or something else. The same goes for derivedByGroup. - if ( typeof spec !== "object" ) { +With this, there would be five types of assignments: +common: All objects. +baseByGroup: Applies to every object that has its base object's property "group" set to the given name. +baseByID: Applies to all objects that have base object consistent with the given ID: +derivedByGroup: Applies to every object that has its property "group" set to the given name. +derivedByID: Applies only to the object with given ID. - console.error( "changeObject: spec must be an object." ); - return; +Assignments of subsequent types override assignments of previous types. +*/ - } +/* +The caching and version control is clumsy (and incomplete). I (Elias) have done some separate testing of ways to do it properly. This must be implemented later. +*/ - for ( const key in spec ) { +/* +ShipState now mainly accounts for load state, by which I mean the states of objects in the ship. We need to find out how to best handle other state properties, like global position, heading etc., not to mention properties that change fast, and that depend on time and current state (motion fluctuations etc.). +*/ - // this ensures all the keys are reassigned to the object - const previous_spec = object.getSpecification()[ key ]; +function ShipState( specification ) { - const new_spec = {}; - new_spec[ key ] = Object.assign( previous_spec, spec[ key ] ); + this.version = 0; + this.objectCache = {}; + this.continuous = {}; + this.discrete = {}; + JSONSpecObject.call( this, specification ); - Object.assign( object, new_spec ); +} - } +ShipState.prototype = Object.create( JSONSpecObject.prototype ); +Object.assign( ShipState.prototype, { + constructor: ShipState, + getSpecification: function () { - } + if ( this.cachedVersion !== this.version ) { - getBaseObjectById( id = undefined ) { + var spec = { + calculationParameters: this.calculationParameters, + objectOverrides: this.objectOverrides//{} + }; - if ( id === undefined ) { + //Sketchy, but versatile: + spec = JSON.parse( JSON.stringify( spec ) ); - return this.baseObjects; + this.specCache = spec; + this.cachedVersion = this.version; } - const ids_array = Array.isArray( id ) ? id : [ id ]; + return this.specCache; - let obj = {}; + }, + clone: function () { - for ( let id of ids_array ) { + return new ShipState( this.getSpecification() ); - const baseObject = this.baseObjects[ id ]; - if ( baseObject ) { + }, + getObjectState: function ( o ) { - obj[ id ] = baseObject; + if ( this.objectCache[ o.id ] !== undefined ) { - } else { + let c = this.objectCache[ o.id ]; + if ( c.thisStateVer === this.version + /*&& c.baseStateVer === o.baseObject.baseStateVersion + && c.refStateVer === o.referenceStateVersion*/ ) { - console.warn( `BaseObject with id ${id} not found.` ); + console.log( "ShipState.getObjectState: Using cache." ); + return c.state; } - } - return obj; - - } - - - changeBaseObjectById( id, spec ) { - - this.validateObjectBond( this.baseObjects, id ); - - this.changeObject( this.baseObjects[ id ], spec ); + console.log( "ShipState.getObjectState: Not using cache." ); - } + let state = {}; + Object.assign( state, o.baseObject.baseState ); + Object.assign( state, o.referenceState ); + let oo = this.objectOverrides; + let sources = [ oo.common, oo.baseByID[ o.baseObject.id ], oo.derivedByGroup[ o.affiliations.group ], oo.derivedByID[ o.id ] ]; + for ( let i = 0; i < sources.length; i ++ ) { - changeDerivedObjectById( id, spec ) { + let s = sources[ i ]; + if ( ! s ) continue; + let sk = Object.keys( s ); + for ( let k of sk ) { - this.validateObjectBond( this.derivedObjects, id ); + //Override existing properties only: + if ( state[ k ] !== undefined ) { - this.changeObject( this.derivedObjects[ id ], spec ); + state[ k ] = s[ k ]; - if ( "baseObject" in spec ) { + } - console.error( "Key 'baseObject' identified under the spec. Please, use change changeBaseObjectById if you want to change the base object." ); - return; + } } - } - - deleteBaseObjectById( id ) { + this.objectCache[ o.id ] = { + thisStateVer: this.version, + /*baseStateVer: o.baseObject.baseStateVersion, + refStateVer: o.referenceStateVersion,*/ + state: state + }; - this.validateObjectBond( this.baseObjects, id ); + return state; - delete this.baseObjects[ id ]; + }, + //o is an object, k is a key to a single state property + getObjectStateProperty: function ( o, k ) { - // Check if an derivedObject is using the deleted object as baseObject - // Delete it in case it is - for ( const [ key, o ] of Object.entries( this.derivedObjects ) ) { + return this.getObjectState( o )[ k ]; + //I have commented out a compact, but not very efficient, implementation of Alejandro's pattern, that does not fit too well with my caching solution. + /* let oo = this.objectOverrides; + let sources = [oo.derivedByID[o.id], oo.derivedByGroup[o.affiliations.group], oo.baseByID[o.baseObject.id], oo.common, o.getReferenceState(), o.baseObject.getBaseState()].filter(e=>!!e); + for (let i = 0; i < sources.length; i++) { + if (sources[i][k] !== undefined) return sources[i][k]; + } + return; //undefined*/ - if ( o.baseObject.id === id ) { + }, + //Sets this state exclusively from parameter. + setFromSpecification: function ( spec ) { - this.deleteDerivedObjectById( key ); + this.objectCache = {}; //reset cache + if ( ! spec ) { - } + Object.assign( this, { + calculationParameters: {}, + //Named overrides because only existing corresponding properties will be set + objectOverrides: { + commmon: {}, + //baseByGroup: {}, + baseByID: {}, + derivedByGroup: {}, + derivedByID: {} + } + } ); + return; } - } - - deleteDerivedObjectById( id ) { - - this.validateObjectBond( this.derivedObjects, id ); + this.calculationParameters = spec.calculationParameters || {}; + this.objectOverrides = {}; + let oo = this.objectOverrides; + let soo = spec.objectOverrides || {}; + oo.common = soo.common || {}; + oo.baseByID = soo.baseByID || {}; + oo.derivedByGroup = soo.derivedByGroup || {}; + oo.derivedByID = soo.derivedByID || {}; - delete this.derivedObjects[ id ]; + this.version ++; - } + return this; - addNewObject( spec ) { + }, + //Overrides existing directives and adds new ones. + extend: function ( spec ) { - if ( typeof spec !== "object" ) { + Object.assign( this.calculationParameters, spec.calculationParameters ); + this.calculatedProperties = {}; + let oo = this.objectOverrides; + let soo = spec.objectOverrides || {}; + Object.assign( oo.common, soo.common ); + let sources = [ soo.baseByID, soo.derivedByGroup, soo.derivedByID ]; + let targets = [ oo.baseByID, oo.derivedByGroup, oo.derivedByID ]; + for ( let i = 0; i < sources.length; i ++ ) { - console.error( "changeObject: spec must be an object." ); - return; + if ( ! sources[ i ] ) continue; + let sk = Object.keys( sources[ i ] ); + for ( let k of sk ) { - } + if ( targets[ i ][ k ] !== undefined ) { - if ( ! Array.isArray( spec.baseObject ) || ! Array.isArray( spec.derivedObjects ) ) { + Object.assign( targets[ i ][ k ], sources[ i ][ k ] ); - console.error( "addObject: spec.baseObject must be an array." ); - return; + } else { - } + targets[ i ][ k ] = sources[ i ][ k ]; - for ( let baseObject of spec.baseObject ) { + } - this.baseObjects[ baseObject.id ] = new BaseObject( baseObject ); + } } - for ( let derivedObject of spec.derivedObjects ) { - - this.validateObjectBond( this.baseObjects, derivedObject.id ); + this.version ++; - this.derivedObjects[ derivedObject.id ] = new DerivedObject( derivedObject, this.baseObjects ); + }, + //Applies only directives of spec that have a corresponding directive in this. + override: function ( spec ) { - } + let oo = this.objectOverrides; + let soo = spec.objectOverrides; - } + let sources = [ spec.calculationParameters, soo.common ]; + let targets = [ this.calculationParameters, oo.common ]; + for ( let i = 0; i < sources.length; i ++ ) { -} + if ( ! sources[ i ] ) continue; + let sk = Object.keys( sources[ i ] ); + for ( let k of sk ) { -class WaveCreator { + if ( targets[ i ][ k ] !== undefined ) { - constructor( defList, waveDuration = 3600 ) { + targets[ i ][ k ] = sources[ i ][ k ]; - this.waveDef = {}; // store wave definition - this.version = 0; // version counter for memorisation pattern - this.defList = defList || [ // list wave definitions - [ 0.6, 2.25, 180 ], - [ 1.1, 1.75, 150 ] - ]; + } - // set a regular wave definition - this.setWaveDef = function setWaveDef( freq, amp, head ) { + } - var newWaveDef; - newWaveDef = { - waveFreq: freq, // angular frequency - waveAmplitude: amp, - heading: head // 0 to 360. 180 corresponds to head seas - }; - if ( JSON.stringify( this.waveDef ) !== JSON.stringify( newWaveDef ) ) { + } - this.waveDef = newWaveDef; - this.version ++; + sources = [ soo.common, soo.baseByID, soo.derivedByGroup, soo.derivedByID ]; + targets = [ oo.common, oo.baseByID, oo.derivedByGroup, oo.derivedByID ]; - } + for ( let i = 0; i < sources.length; i ++ ) { - }; + if ( ! sources[ i ] ) continue; + let specKeys = Object.keys( sources[ i ] ); + for ( let key of specKeys ) { - this.setRandom = function () { // set a wave definition randomly + if ( targets[ i ][ key ] !== undefined ) { - var rand = this.defList[ Math.floor( Math.random() * this.defList.length ) ]; - this.setWaveDef( rand[ 0 ], rand[ 1 ], rand[ 2 ] ); + let t = targets[ i ][ key ]; + let s = sources[ i ][ key ]; + if ( ! s ) continue; + let sk = Object.keys( s ); + //Loop over individual properties in assignments, and override only: + for ( let k of sk ) { - }; + if ( t[ k ] !== undefined ) { - this.setTime = function ( time ) { + t[ k ] = s[ k ]; - // change wave definition along time - var noSpans = time / this.waveDuration; - var coord = Math.floor( noSpans % this.defList.length ); + } - this.setWaveDef( this.defList[ coord ][ 0 ], this.defList[ coord ][ 1 ], this.defList[ coord ][ 2 ] ); + } - }; + } - } + } -} + } -class StateModule { + this.version ++; - constructor( ship, states ) { + } +} ); +function StateModule( ship, states ) { - this.ship = ship; - this.states = states; + this.ship = ship; + this.states = states; - } +} - returnOutput() { +Object.assign( StateModule.prototype, { + // return getters listed on an output array inside the simulation object + returnOutput: function () { let resObj = {}; for ( let i = 0; i < this.output.length; i ++ ) { @@ -2454,10 +2259,9 @@ class StateModule { return resObj; - } - + }, // write getter output to shipState - writeOutput() { + writeOutput: function () { let stateName = this.constructor.name; if ( this.states.discrete[ stateName ] === undefined ) { @@ -2486,9 +2290,8 @@ class StateModule { this.states.discrete[ stateName ].thisStateVer ++; - } - - setDraft() { + }, + setDraft: function () { let draft = this.ship.calculateDraft( this.states ); if ( this.states.discrete.FloatingCondition === undefined ) { @@ -2504,11 +2307,9 @@ class StateModule { Object.assign( this.states.discrete.FloatingCondition.state, this.ship.calculateStability( this.states ) ); this.states.discrete.FloatingCondition.thisStateVer ++; - - } - + }, // write argument speed to vessel state. If undefined, use vessel's design speed - setSpeed( speed ) { + setSpeed: function ( speed ) { if ( this.states.discrete.Speed === undefined ) { @@ -2528,11 +2329,10 @@ class StateModule { this.states.discrete.Speed.state.speed = speed; // knots this.states.discrete.Speed.thisStateVer ++; - } - + }, // write argument heading angle to vessel state. if undefined, use 0 degrees // 0 degrees corresponds to vessel pointing to north. clockwise orientation. - setHeading( angle ) { + setHeading: function ( angle ) { if ( this.states.discrete.Heading === undefined ) { @@ -2552,11 +2352,10 @@ class StateModule { this.states.discrete.Heading.state.heading = angle; this.states.discrete.Heading.thisStateVer ++; - } - - // cache memoization pattern adapted from https://b-studios.de/javascript/languages/2013/11/18/lazy-attributes-in-ecmascript-5 + }, + // cache memoization pattern adapted from http://b-studios.de/blog/2013/11/18/lazy-attributes-in-ecmascript-5/ // in the future, expand version comparison also to parameters stored inside each constructor - memoized( init, cacheName ) { + memoized: function ( init, cacheName ) { return { enumerable: true, @@ -2640,1311 +2439,1415 @@ class StateModule { }; } +} ); +// simple function to output regular wave pattern +function WaveCreator( defList, waveDuration = 3600 ) { // wave creator constructor + this.waveDef = {}; // store wave definition + this.version = 0; // version counter for memorisation pattern + // set a regular wave definition + this.setWaveDef = function ( freq, amp, head ) { -} - -class WaveMotion extends StateModule { + var newWaveDef; + newWaveDef = { + waveFreq: freq, // angular frequency + waveAmplitude: amp, + heading: head // 0 to 360. 180 corresponds to head seas + }; + if ( JSON.stringify( this.waveDef ) !== JSON.stringify( newWaveDef ) ) { - constructor( ship, states, wavCre, position = 0, critDampPercentage = 20, g = 9.81, rho = 1025 ) { + this.waveDef = newWaveDef; + this.version ++; - super( ship, states ); + } - if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { + }; - this.setDraft(); + this.defList = defList || [ // list wave definitions + [ 0.6, 2.25, 180 ], + [ 1.1, 1.75, 150 ] + ]; + this.setRandom = function () { // set a wave definition randomly - } + var rand = this.defList[ Math.floor( Math.random() * this.defList.length ) ]; + this.setWaveDef( rand[ 0 ], rand[ 1 ], rand[ 2 ] ); - if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state + }; - this.setSpeed(); // use its design speed + this.setTime = function ( time ) { - } + // change wave definition along time + var noSpans = time / waveDuration; + var coord = Math.floor( noSpans % this.defList.length ); - if ( typeof this.states.discrete.Heading === "undefined" ) { + this.setWaveDef( this.defList[ coord ][ 0 ], this.defList[ coord ][ 1 ], this.defList[ coord ][ 2 ] ); - this.setHeading(); + }; - } +} +// adapted from http://www.shiplab.ntnu.co/app/shipmotion/ - this.floatState = this.states.discrete.FloatingCondition.state; - this.speedState = this.states.discrete.Speed.state; - this.headingState = this.states.discrete.Heading.state; - this.wavCre = wavCre; - this.position = position; // measured position in % of LOA - this.g = g; - this.rho = rho; - this.critical_damping_percentage = critDampPercentage; // this parameter is used to take into account the water viscosity - this.delta = this.ship.structure.hull.attributes.prismaticLengthRatio; // length ratio of two prismatic bodies that represent the ship - this.output = [ "verticalMotion" ]; +function WaveMotion( ship, states, wavCre, position = 0, critDampPercentage = 20, g = 9.81, rho = 1025 ) { - this.cacheDependence = [ "FloatingCondition", "Speed", "Heading" ]; - this.cache = {}; + StateModule.call( this, ship, states ); + if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { - Object.defineProperties( this, { - coefficients: StateModule.prototype.memoized( function () { + this.setDraft(); - var bethaDeg = Math.abs( this.wavCre.waveDef.heading - this.headingState.heading ); - var betha = bethaDeg * Math.PI / 180; - var speedSI = 0.514444 * this.speedState.speed; - var Froude_N = speedSI / Math.sqrt( this.g * this.floatState.LWL ); - //var wave_period = 2*Math.PI/this.wavCre.waveDef.waveFreq; - var wave_number = Math.pow( this.wavCre.waveDef.waveFreq, 2 ) / this.g; - var eff_wave_number = Math.abs( wave_number * Math.cos( betha ) ); - var smith_factor = Math.exp( - wave_number * this.floatState.T ); - var alpha = 1 - Froude_N * Math.sqrt( wave_number * this.floatState.LWL ) * Math.cos( betha ); - var encounter_frequency = this.wavCre.waveDef.waveFreq * alpha; + } - return { betha, Froude_N, wave_number, eff_wave_number, smith_factor, alpha, encounter_frequency }; + if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state - }, "coefficients" ), - verticalMotion: StateModule.prototype.memoized( function () { + this.setSpeed(); // use its design speed - var Breadth = this.floatState.BWL * this.floatState.Cb; - var cgDistance = this.position / 100 * this.ship.structure.hull.attributes.LOA - this.states.discrete.FloatingCondition.state.w.cg.x; - var sectional_hydro_damping = 2 * Math.sin( 0.5 * this.coefficients.wave_number * Breadth * Math.pow( this.coefficients.alpha, 2 ) ) * Math.exp( - this.coefficients.wave_number * - this.floatState.T * Math.pow( this.coefficients.alpha, 2 ) ); + } - var a, b; - a = Math.pow( 1 - this.coefficients.wave_number * this.floatState.T, 2 ); - b = Math.pow( ( Math.pow( sectional_hydro_damping, 2 ) / ( this.coefficients.wave_number * Breadth * Math.pow( this.coefficients.alpha, 3 ) ) ), 2 ); - var f = Math.sqrt( a + b ); - var eta = 1 / ( Math.sqrt( Math.pow( ( 1 - 2 * this.coefficients.wave_number * this.floatState.T * Math.pow( this.coefficients.alpha, 2 ) ), 2 ) + Math.pow( Math.pow( sectional_hydro_damping, 2 ) / - ( this.coefficients.wave_number * Breadth * Math.pow( this.coefficients.alpha, 2 ) ), 2 ) ) ); + if ( typeof this.states.discrete.Heading === "undefined" ) { - var F = this.coefficients.smith_factor * f * ( 2 / ( this.coefficients.eff_wave_number * this.floatState.LWL ) ) * Math.sin( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ); - var FRF_Heave = this.wavCre.waveDef.waveAmplitude * eta * F; + this.setHeading(); - var G = this.coefficients.smith_factor * f * ( 24 / ( Math.pow( this.coefficients.eff_wave_number * this.floatState.LWL, 2 ) * this.floatState.LWL ) ) * ( Math.sin( this.coefficients.eff_wave_number * - this.floatState.LWL / 2 ) - ( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) * Math.cos( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) ); - var FRF_Pitch = this.wavCre.waveDef.waveAmplitude * eta * G; + } - var Pitch_Movement = Math.abs( FRF_Pitch * cgDistance ); - var Pitch_Acceleration = Math.pow( this.coefficients.encounter_frequency, 2 ) * Pitch_Movement; + this.floatState = this.states.discrete.FloatingCondition.state; + this.speedState = this.states.discrete.Speed.state; + this.headingState = this.states.discrete.Heading.state; + this.wavCre = wavCre; + this.position = position; // measured position in % of LOA + this.g = g; + this.rho = rho; + this.critical_damping_percentage = critDampPercentage; // this parameter is used to take into account the water viscosity + this.delta = this.ship.structure.hull.attributes.prismaticLengthRatio; // length ratio of two prismatic bodies that represent the ship + this.output = [ "verticalMotion" ]; - var Heave_Amplitude = Math.abs( FRF_Heave ); - var Heave_Acceleration = Math.pow( this.coefficients.encounter_frequency, 2 ) * Math.abs( FRF_Heave ); + this.cacheDependence = [ "FloatingCondition", "Speed", "Heading" ]; + this.cache = {}; - var Vertical_Movement = Math.sqrt( Math.pow( Heave_Amplitude, 2 ) + Math.pow( Pitch_Movement, 2 ) ); - var Vertical_Acceleration = Math.pow( this.coefficients.encounter_frequency, 2 ) * Vertical_Movement; +} - return { - pitchAmp: FRF_Pitch, pitchMov: Pitch_Movement, pitchAcc: Pitch_Acceleration, heaveAmp: Heave_Amplitude, heaveAcc: Heave_Acceleration, - verticalMov: Vertical_Movement, verticalAcc: Vertical_Acceleration - }; +WaveMotion.prototype = Object.create( StateModule.prototype ); - }, "verticalMotion" ), - bendingMoment: StateModule.prototype.memoized( function () { +Object.assign( WaveMotion.prototype, { + constructor: WaveMotion +} ); - var Cb_mom = Math.max( 0.6, this.floatState.Cb ); - var phi = 2.5 * ( 1 - Cb_mom ); - var F_Cb = Math.pow( 1 - phi, 2 ) + 0.6 * this.coefficients.alpha * ( 2 - phi ); - var F_v = 1 + 3 * Math.pow( this.coefficients.Froude_N, 2 ); - return this.wavCre.waveDef.waveAmplitude * ( this.coefficients.smith_factor * ( ( 1 - this.coefficients.wave_number * this.floatState.T ) / ( Math.pow( this.floatState.LWL * this.coefficients.eff_wave_number, 2 ) ) ) * - ( 1 - Math.cos( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) - ( this.coefficients.eff_wave_number * this.floatState.LWL / 4 ) * Math.sin( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) ) * - F_v * F_Cb * Math.pow( Math.abs( Math.cos( this.coefficients.betha ) ), 1 / 3 ) ) * this.rho * this.g * this.floatState.BWL * Math.pow( this.floatState.LWL, 2 ) / 1000000; +Object.defineProperties( WaveMotion.prototype, { + coefficients: StateModule.prototype.memoized( function () { - }, "bendingMoment" ), - rollAmp: StateModule.prototype.memoized( function () { + var bethaDeg = Math.abs( this.wavCre.waveDef.heading - this.headingState.heading ); + var betha = bethaDeg * Math.PI / 180; + var speedSI = 0.514444 * this.speedState.speed; + var Froude_N = speedSI / Math.sqrt( this.g * this.floatState.LWL ); + //var wave_period = 2*Math.PI/this.wavCre.waveDef.waveFreq; + var wave_number = Math.pow( this.wavCre.waveDef.waveFreq, 2 ) / this.g; + var eff_wave_number = Math.abs( wave_number * Math.cos( betha ) ); + var smith_factor = Math.exp( - wave_number * this.floatState.T ); + var alpha = 1 - Froude_N * Math.sqrt( wave_number * this.floatState.LWL ) * Math.cos( betha ); + var encounter_frequency = this.wavCre.waveDef.waveFreq * alpha; - // estimate natural roll period - var naturalPeriod = ( 2 * this.floatState.BWL * Math.PI * ( 0.35 + 0.45 ) / 2 ) / Math.pow( this.g * this.floatState.GMt, 0.5 ); + return { betha, Froude_N, wave_number, eff_wave_number, smith_factor, alpha, encounter_frequency }; - var breadth_ratio = ( this.floatState.Cwp - this.delta ) / ( 1 - this.delta ); - var A_0 = this.floatState.Cb * this.floatState.BWL * this.floatState.T / ( this.delta + breadth_ratio * ( 1 - this.delta ) ); + }, "coefficients" ), + verticalMotion: StateModule.prototype.memoized( function () { - var Breadth_draft_ratio0 = this.floatState.BWL / this.floatState.T; - var a0, b0, d0; - if ( ( 3 <= Breadth_draft_ratio0 ) && ( Breadth_draft_ratio0 <= 6 ) ) { + var Breadth = this.floatState.BWL * this.floatState.Cb; + var cgDistance = this.position / 100 * this.ship.structure.hull.attributes.LOA - this.states.discrete.FloatingCondition.state.w.cg.x; + var sectional_hydro_damping = 2 * Math.sin( 0.5 * this.coefficients.wave_number * Breadth * Math.pow( this.coefficients.alpha, 2 ) ) * Math.exp( - this.coefficients.wave_number * + this.floatState.T * Math.pow( this.coefficients.alpha, 2 ) ); - a0 = 0.256 * Breadth_draft_ratio0 - 0.286; - b0 = - 0.11 * Breadth_draft_ratio0 - 2.55; - d0 = 0.033 * Breadth_draft_ratio0 - 1.419; + var a, b; + a = Math.pow( 1 - this.coefficients.wave_number * this.floatState.T, 2 ); + b = Math.pow( ( Math.pow( sectional_hydro_damping, 2 ) / ( this.coefficients.wave_number * Breadth * Math.pow( this.coefficients.alpha, 3 ) ) ), 2 ); + var f = Math.sqrt( a + b ); + var eta = 1 / ( Math.sqrt( Math.pow( ( 1 - 2 * this.coefficients.wave_number * this.floatState.T * Math.pow( this.coefficients.alpha, 2 ) ), 2 ) + Math.pow( Math.pow( sectional_hydro_damping, 2 ) / + ( this.coefficients.wave_number * Breadth * Math.pow( this.coefficients.alpha, 2 ) ), 2 ) ) ); - } else if ( ( 1 <= Breadth_draft_ratio0 ) && ( Breadth_draft_ratio0 < 3 ) ) { + var F = this.coefficients.smith_factor * f * ( 2 / ( this.coefficients.eff_wave_number * this.floatState.LWL ) ) * Math.sin( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ); + var FRF_Heave = this.wavCre.waveDef.waveAmplitude * eta * F; - a0 = - 3.94 * Breadth_draft_ratio0 + 13.69; - b0 = - 2.12 * Breadth_draft_ratio0 - 1.89; - d0 = 1.16 * Breadth_draft_ratio0 - 7.97; + var G = this.coefficients.smith_factor * f * ( 24 / ( Math.pow( this.coefficients.eff_wave_number * this.floatState.LWL, 2 ) * this.floatState.LWL ) ) * ( Math.sin( this.coefficients.eff_wave_number * + this.floatState.LWL / 2 ) - ( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) * Math.cos( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) ); + var FRF_Pitch = this.wavCre.waveDef.waveAmplitude * eta * G; - } else { + var Pitch_Movement = Math.abs( FRF_Pitch * cgDistance ); + var Pitch_Acceleration = Math.pow( this.coefficients.encounter_frequency, 2 ) * Pitch_Movement; - console.error( "The B/T relation is not being respected for the roll formula. It should be 1 <= B/T < 6, not" + " " + ( this.floatState.BWL / this.floatState.T ).toFixed( 2 ) + "." ); + var Heave_Amplitude = Math.abs( FRF_Heave ); + var Heave_Acceleration = Math.pow( this.coefficients.encounter_frequency, 2 ) * Math.abs( FRF_Heave ); - } + var Vertical_Movement = Math.sqrt( Math.pow( Heave_Amplitude, 2 ) + Math.pow( Pitch_Movement, 2 ) ); + var Vertical_Acceleration = Math.pow( this.coefficients.encounter_frequency, 2 ) * Vertical_Movement; - var b_44_0 = this.rho * A_0 * Math.pow( this.floatState.BWL, 2 ) * a0 * Math.exp( b0 * Math.pow( this.coefficients.encounter_frequency, - 1.3 ) ) * Math.pow( this.coefficients.encounter_frequency, d0 ) / - ( Math.sqrt( this.floatState.BWL / ( 2 * this.g ) ) ); + return { + pitchAmp: FRF_Pitch, pitchMov: Pitch_Movement, pitchAcc: Pitch_Acceleration, heaveAmp: Heave_Amplitude, heaveAcc: Heave_Acceleration, + verticalMov: Vertical_Movement, verticalAcc: Vertical_Acceleration + }; - var A_1 = breadth_ratio * A_0; - var B_1 = breadth_ratio * this.floatState.BWL; - var Breadth_draft_ratio1 = B_1 / this.floatState.T; - var a1, b1, d1; - if ( ( 3 <= Breadth_draft_ratio1 ) && ( Breadth_draft_ratio1 <= 6 ) ) { + }, "verticalMotion" ), + bendingMoment: StateModule.prototype.memoized( function () { - a1 = 0.256 * Breadth_draft_ratio1 - 0.286; - b1 = - 0.11 * Breadth_draft_ratio1 - 2.55; - d1 = 0.033 * Breadth_draft_ratio1 - 1.419; + var Cb_mom = Math.max( 0.6, this.floatState.Cb ); + var phi = 2.5 * ( 1 - Cb_mom ); + var F_Cb = Math.pow( 1 - phi, 2 ) + 0.6 * this.coefficients.alpha * ( 2 - phi ); + var F_v = 1 + 3 * Math.pow( this.coefficients.Froude_N, 2 ); + return this.wavCre.waveDef.waveAmplitude * ( this.coefficients.smith_factor * ( ( 1 - this.coefficients.wave_number * this.floatState.T ) / ( Math.pow( this.floatState.LWL * this.coefficients.eff_wave_number, 2 ) ) ) * + ( 1 - Math.cos( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) - ( this.coefficients.eff_wave_number * this.floatState.LWL / 4 ) * Math.sin( this.coefficients.eff_wave_number * this.floatState.LWL / 2 ) ) * + F_v * F_Cb * Math.pow( Math.abs( Math.cos( this.coefficients.betha ) ), 1 / 3 ) ) * this.rho * this.g * this.floatState.BWL * Math.pow( this.floatState.LWL, 2 ) / 1000000; - } else if ( ( 1 <= Breadth_draft_ratio1 ) && ( Breadth_draft_ratio1 < 3 ) ) { + }, "bendingMoment" ), + rollAmp: StateModule.prototype.memoized( function () { - a1 = - 3.94 * Breadth_draft_ratio1 + 13.69; - b1 = - 2.12 * Breadth_draft_ratio1 - 1.89; - d1 = 1.16 * Breadth_draft_ratio1 - 7.97; + // estimate natural roll period + var naturalPeriod = ( 2 * this.floatState.BWL * Math.PI * ( 0.35 + 0.45 ) / 2 ) / Math.pow( this.g * this.floatState.GMt, 0.5 ); - } else { + var breadth_ratio = ( this.floatState.Cwp - this.delta ) / ( 1 - this.delta ); + var A_0 = this.floatState.Cb * this.floatState.BWL * this.floatState.T / ( this.delta + breadth_ratio * ( 1 - this.delta ) ); - console.error( "The vessel dimensions are out of range for the roll formula." ); + var Breadth_draft_ratio0 = this.floatState.BWL / this.floatState.T; + var a0, b0, d0; + if ( ( 3 <= Breadth_draft_ratio0 ) && ( Breadth_draft_ratio0 <= 6 ) ) { - } + a0 = 0.256 * Breadth_draft_ratio0 - 0.286; + b0 = - 0.11 * Breadth_draft_ratio0 - 2.55; + d0 = 0.033 * Breadth_draft_ratio0 - 1.419; - var b_44_1 = this.rho * A_1 * Math.pow( B_1, 2 ) * a1 * Math.exp( b1 * Math.pow( this.coefficients.encounter_frequency, - 1.3 ) ) * Math.pow( this.coefficients.encounter_frequency, d1 ) / - ( Math.sqrt( B_1 / ( 2 * this.g ) ) ); + } else if ( ( 1 <= Breadth_draft_ratio0 ) && ( Breadth_draft_ratio0 < 3 ) ) { - var b_44 = this.floatState.LWL * b_44_0 * ( this.delta + b_44_1 * ( 1 - this.delta ) / b_44_0 ); - var critical_damping_frac = this.critical_damping_percentage / 100; - var restoring_moment_coeff = this.g * this.rho * this.floatState.Cb * this.floatState.LWL * this.floatState.BWL * this.floatState.T * this.floatState.GMt; - var add_damping = restoring_moment_coeff * naturalPeriod / Math.PI; + a0 = - 3.94 * Breadth_draft_ratio0 + 13.69; + b0 = - 2.12 * Breadth_draft_ratio0 - 1.89; + d0 = 1.16 * Breadth_draft_ratio0 - 7.97; - var damping_ratio = Math.sqrt( b_44_1 / b_44_0 ); - var roll_hydro_damping = b_44 + add_damping * critical_damping_frac; + } else { - var excitation_frequency, A, B, C, D; + console.error( "The B/T relation is not being respected for the roll formula. It should be 1 <= B/T < 6, not" + " " + ( this.floatState.BWL / this.floatState.T ).toFixed( 2 ) + "." ); - if ( this.wavCre.waveDef.heading == 90 || this.wavCre.waveDef.heading == 270 ) { + } - excitation_frequency = Math.sqrt( this.rho * Math.pow( this.g, 2 ) * b_44_0 / this.coefficients.encounter_frequency ) * ( this.delta + damping_ratio * - ( 1 - this.delta ) ) * this.floatState.LWL; + var b_44_0 = this.rho * A_0 * Math.pow( this.floatState.BWL, 2 ) * a0 * Math.exp( b0 * Math.pow( this.coefficients.encounter_frequency, - 1.3 ) ) * Math.pow( this.coefficients.encounter_frequency, d0 ) / + ( Math.sqrt( this.floatState.BWL / ( 2 * this.g ) ) ); - } else { + var A_1 = breadth_ratio * A_0; + var B_1 = breadth_ratio * this.floatState.BWL; + var Breadth_draft_ratio1 = B_1 / this.floatState.T; + var a1, b1, d1; + if ( ( 3 <= Breadth_draft_ratio1 ) && ( Breadth_draft_ratio1 <= 6 ) ) { - A = Math.abs( Math.sin( this.coefficients.betha ) ) * Math.sqrt( this.rho * Math.pow( this.g, 2 ) / this.coefficients.encounter_frequency ) * Math.sqrt( b_44_0 ) * 2 / this.coefficients.eff_wave_number; - B = Math.pow( Math.sin( 0.5 * this.delta * this.floatState.LWL * this.coefficients.eff_wave_number ), 2 ); - C = Math.pow( damping_ratio * Math.sin( 0.5 * ( 1 - this.delta ) * this.floatState.LWL * this.coefficients.eff_wave_number ), 2 ); - D = 2 * damping_ratio * Math.sin( 0.5 * this.delta * this.floatState.LWL * this.coefficients.eff_wave_number ) * Math.sin( 0.5 * ( 1 - this.delta ) * - this.floatState.LWL * this.coefficients.eff_wave_number ) * Math.cos( 0.5 * this.floatState.LWL * this.coefficients.eff_wave_number ); - excitation_frequency = A * Math.sqrt( B + C + D ); + a1 = 0.256 * Breadth_draft_ratio1 - 0.286; + b1 = - 0.11 * Breadth_draft_ratio1 - 2.55; + d1 = 0.033 * Breadth_draft_ratio1 - 1.419; - } + } else if ( ( 1 <= Breadth_draft_ratio1 ) && ( Breadth_draft_ratio1 < 3 ) ) { - A = Math.pow( - Math.pow( this.coefficients.encounter_frequency * naturalPeriod / ( 2 * Math.PI ), 2 ) + 1, 2 ); - B = Math.pow( restoring_moment_coeff, 2 ); - C = Math.pow( this.coefficients.encounter_frequency * roll_hydro_damping, 2 ); + a1 = - 3.94 * Breadth_draft_ratio1 + 13.69; + b1 = - 2.12 * Breadth_draft_ratio1 - 1.89; + d1 = 1.16 * Breadth_draft_ratio1 - 7.97; - return this.wavCre.waveDef.waveAmplitude * excitation_frequency / ( Math.sqrt( A * B + C ) ); + } else { - }, "rollAmp" ) - } ); + console.error( "The vessel dimensions are out of range for the roll formula." ); - } + } -} + var b_44_1 = this.rho * A_1 * Math.pow( B_1, 2 ) * a1 * Math.exp( b1 * Math.pow( this.coefficients.encounter_frequency, - 1.3 ) ) * Math.pow( this.coefficients.encounter_frequency, d1 ) / + ( Math.sqrt( B_1 / ( 2 * this.g ) ) ); -// partially adapted from http://www.shiplab.ntnu.co/app/holtrop/ + var b_44 = this.floatState.LWL * b_44_0 * ( this.delta + b_44_1 * ( 1 - this.delta ) / b_44_0 ); + var critical_damping_frac = this.critical_damping_percentage / 100; + var restoring_moment_coeff = this.g * this.rho * this.floatState.Cb * this.floatState.LWL * this.floatState.BWL * this.floatState.T * this.floatState.GMt; + var add_damping = restoring_moment_coeff * naturalPeriod / Math.PI; + var damping_ratio = Math.sqrt( b_44_1 / b_44_0 ); + var roll_hydro_damping = b_44 + add_damping * critical_damping_frac; -class HullResistance extends StateModule { + var excitation_frequency, A, B, C, D; - constructor( ship, states, propeller, wavCre, g = 9.81, rho = 1025, mi = 0.00122 ) { + if ( this.wavCre.waveDef.heading == 90 || this.wavCre.waveDef.heading == 270 ) { - super( ship, states ); - this.propeller = propeller; + excitation_frequency = Math.sqrt( this.rho * Math.pow( this.g, 2 ) * b_44_0 / this.coefficients.encounter_frequency ) * ( this.delta + damping_ratio * + ( 1 - this.delta ) ) * this.floatState.LWL; - if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { + } else { - this.setDraft(); + A = Math.abs( Math.sin( this.coefficients.betha ) ) * Math.sqrt( this.rho * Math.pow( this.g, 2 ) / this.coefficients.encounter_frequency ) * Math.sqrt( b_44_0 ) * 2 / this.coefficients.eff_wave_number; + B = Math.pow( Math.sin( 0.5 * this.delta * this.floatState.LWL * this.coefficients.eff_wave_number ), 2 ); + C = Math.pow( damping_ratio * Math.sin( 0.5 * ( 1 - this.delta ) * this.floatState.LWL * this.coefficients.eff_wave_number ), 2 ); + D = 2 * damping_ratio * Math.sin( 0.5 * this.delta * this.floatState.LWL * this.coefficients.eff_wave_number ) * Math.sin( 0.5 * ( 1 - this.delta ) * + this.floatState.LWL * this.coefficients.eff_wave_number ) * Math.cos( 0.5 * this.floatState.LWL * this.coefficients.eff_wave_number ); + excitation_frequency = A * Math.sqrt( B + C + D ); } - if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state + A = Math.pow( - Math.pow( this.coefficients.encounter_frequency * naturalPeriod / ( 2 * Math.PI ), 2 ) + 1, 2 ); + B = Math.pow( restoring_moment_coeff, 2 ); + C = Math.pow( this.coefficients.encounter_frequency * roll_hydro_damping, 2 ); - this.setSpeed(); // use its design speed + return this.wavCre.waveDef.waveAmplitude * excitation_frequency / ( Math.sqrt( A * B + C ) ); - } + }, "rollAmp" ) +} ); +function Positioning( ship, states, path ) { - this.speedState = this.states.discrete.Speed.state; - this.floatState = this.states.discrete.FloatingCondition.state; - this.wavCre = wavCre; - this.g = g; - this.rho = rho; - this.mi = mi; // dynamic viscosity - this.b = this.ship.structure.hull.attributes.bulb; // has a bulb? Boolean. - this.tr = this.ship.structure.hull.attributes.transom; // transom. Boolean. - this.cstern = this.ship.structure.hull.attributes.cstern; // afterbody form. - // Pram with Gondola = -25, V-Shaped Sections = -10, Normal Section Shape = 0, U-Shaped Sections with Hognes Stern = 10 - this.appendices = this.ship.structure.hull.attributes.appendices; // appendices information - // skegRudder has coeff from 1.5 to 2.0 - // sternRudder has coeff from 1.3 to 1.5 - // twinScrewBalanceRudder has coeff 2.8 - // shaftBrackets has coeff 3.0 - // skeg has coeff from 1.5 to 2.0 - // strutBossings has coeff 3.0 - // hullBossings has coeff 2.0 - // shafts have coeff from 2 to 4 - // stabilizerFins has coeff 2.8 - // dome has coeff 2.7 - // bilgeKeel has coeff 1.4 - this.output = [ "totalResistance", "efficiency" ]; + this.ship = ship; + this.states = states; - this.cacheDependence = [ "FloatingCondition", "Speed" ]; - this.cache = {}; + this.routeData = {}; + this.routeData.pathVec = []; + this.routeData.unitPath = []; + this.routeData.heading = []; + this.routeData.totalDist = 0; + this.routeData.legDistance = []; + for ( var leg = 0; leg < path.length - 1; leg ++ ) { - Object.defineProperties( this, { - coefficients: StateModule.prototype.memoized( function () { + this.routeData.pathVec[ leg ] = path[ leg + 1 ].map( ( num, idx ) => num - path[ leg ][ idx ] ); + this.routeData.legDistance[ leg ] = Math.sqrt( this.routeData.pathVec[ leg ].map( ( num ) => Math.pow( num, 2 ) ).reduce( ( num1, num2 ) => num1 + num2 ) ); + this.routeData.unitPath[ leg ] = this.routeData.pathVec[ leg ].map( ( num ) => num / this.routeData.legDistance[ leg ] ); - let lcb = 100 * ( this.floatState.LCB - ( this.floatState.minXs + this.floatState.LWL / 2 ) ) / this.floatState.LWL; // % + // get heading in relation to North/y axis + var heading = Math.acos( this.routeData.pathVec[ leg ][ 1 ] / this.routeData.legDistance[ leg ] ); + heading *= 180 / Math.PI; // convert to degrees - let Tfore; - if ( this.floatState.draftfp === null ) { + if ( this.routeData.pathVec[ leg ][ 0 ] < 0 ) { - Tfore = this.floatState.T; + heading = 360 - heading; - } else { + } - Tfore = this.floatState.draftfp; + this.routeData.heading[ leg ] = heading; - } + this.routeData.totalDist += this.routeData.legDistance[ leg ]; - let Taft; - if ( this.floatState.draftap === null ) { + } - Taft = this.floatState.T; + // initialize vessel on path + this.states.continuous.Positioning = {}; + this.states.continuous.Positioning.position = path[ 0 ]; + this.states.continuous.Positioning.travelLegDist = 0; + this.states.continuous.Positioning.travelDist = 0; + this.positionState = this.states.continuous.Positioning; - } else { + this.states.discrete.Leg = { + state: { + leg: 0 + }, + thisStateVer: 1 + }; + this.legState = this.states.discrete.Leg.state; - Taft = this.floatState.draftap; + if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state - } + StateModule.prototype.setSpeed.call( this ); // use its design speed - let T = ( Tfore + Taft ) / 2; // m, average draft - let hb = Tfore / 2; - let abt = Math.PI * Math.pow( Tfore / 2, 2 ) * this.b / 7.7; // transverse sectional bulb area - let c3 = 0.56 * ( Math.pow( abt, 1.5 ) ) / ( this.floatState.BWL * T * ( 0.31 * Math.pow( abt, 0.5 ) + Tfore - hb ) ); - let c2 = Math.exp( - 1.89 * Math.pow( c3, 0.5 ) ); + } - let c4; - if ( Tfore / this.floatState.LWL > 0.04 ) { + if ( typeof this.states.discrete.Heading === "undefined" ) { - c4 = 0.04; + StateModule.prototype.setHeading.call( this, this.routeData.heading[ 0 ] ); - } else { + } - c4 = Tfore / this.floatState.LWL; + this.advanceShip = function ( timeStep ) { // calculate advanced distance during one time step - } + var remVec, remDist; + var advDist = timeStep * 1 / 3600 * this.states.discrete.Speed.state.speed; - // correlation allowance coefficient - let ca = 0.006 * Math.pow( this.floatState.LWL + 100, - 0.16 ) - 0.00205 + 0.003 * Math.pow( this.floatState.LWL / 7.5, 0.5 ) * Math.pow( this.floatState.Cb, 4 ) * c2 * ( 0.04 - c4 ); - let wa = this.floatState.LWL * ( 2 * T + this.floatState.BWL ) * Math.pow( this.floatState.Cm, 0.5 ) * ( 0.453 + 0.4425 * this.floatState.Cb - 0.2862 * this.floatState.Cm - 0.003467 * - this.floatState.BWL / T + 0.3696 * this.floatState.Cwp ) + 2.38 * abt / this.floatState.Cb; // wetted area + while ( 0 < advDist ) { - let lr = this.floatState.LWL * ( 1 - this.floatState.Cp + ( 0.06 * this.floatState.Cp * ( lcb / 100 ) / ( 4 * this.floatState.Cp - 1 ) ) ); - let c14 = 1 + 0.011 * this.cstern; - let k = 0.93 + ( 0.487118 * c14 * Math.pow( this.floatState.BWL / this.floatState.LWL, 1.06806 ) * Math.pow( T / this.floatState.LWL, 0.46106 ) * Math.pow( this.floatState.LWL / - lr, 0.121563 ) * Math.pow( Math.pow( this.floatState.LWL, 3 ) / this.floatState.Vs, 0.36486 ) * Math.pow( 1 - this.floatState.Cp, - 0.604247 ) ); // form factor + remVec = path[ this.legState.leg + 1 ].map( ( num, idx ) => num - this.positionState.position[ idx ] ); + remDist = Math.sqrt( remVec.map( ( num ) => Math.pow( num, 2 ) ).reduce( ( num1, num2 ) => num1 + num2 ) ); + if ( advDist <= remDist ) { - let speedSI = 0.514444 * this.speedState.speed; // convert the speed from knots to m/s - let re = this.rho * this.floatState.LWL * speedSI / this.mi; // Reynolds number - let cf = 0.075 / Math.pow( ( Math.log( re ) / Math.log( 10 ) ) - 2, 2 ); // frictional coefficient + this.positionState.position = this.positionState.position.map( ( num, idx ) => num + advDist * this.routeData.unitPath[ this.legState.leg ][ idx ] ); - return { lcb, Tfore, Taft, T, hb, c2, ca, abt, wa, lr, k, speedSI, cf }; + // add to traveled distance + this.positionState.travelLegDist = this.positionState.travelLegDist + advDist; + this.positionState.travelDist = this.positionState.travelDist + advDist; - }, "coefficients" ), - calmResistance: StateModule.prototype.memoized( function () { // N, total hull resistance in calm waters + advDist = 0; - let at = 0.95 * ( this.coefficients.Taft - this.coefficients.Taft * 0.9225 ) * this.floatState.BWL * 0.89 * this.tr; // transom stern area - let rf = 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * this.coefficients.wa * this.coefficients.cf; // frictional resistance + } else if ( path[ this.legState.leg + 2 ] !== undefined ) { // trip has another leg - let fnt; - if ( at === 0 ) { + // change direction and continue sailing + advDist -= remDist; + this.positionState.position = path[ this.legState.leg + 1 ]; - fnt = 0; + // add to traveled distance + this.positionState.travelLegDist = 0; + this.positionState.travelDist = this.positionState.travelDist + remDist; - } else { + this.legState.leg ++; + this.states.discrete.Leg.thisStateVer ++; - fnt = this.coefficients.speedSI / ( Math.pow( 2 * this.g * at / ( this.floatState.BWL + this.floatState.BWL * this.floatState.Cwp ), 0.5 ) ); + StateModule.prototype.setHeading.call( this, this.routeData.heading[ this.legState.leg ] ); + console.log( "Vessel reached pivot point in navigation and entered leg " + this.legState.leg + "." ); - } + } else { - let c6; - if ( fnt < 5 ) { + this.positionState.position = this.positionState.position.map( ( num, idx ) => num + advDist * this.routeData.unitPath[ this.legState.leg ][ idx ] ); - c6 = 0.2 * ( 1 - 0.2 * fnt ); + // add to traveled distance + this.positionState.travelLegDist = this.positionState.travelLegDist + advDist; + this.positionState.travelDist = this.positionState.travelDist + advDist; - } else { + console.log( "Vessel reached final destination." ); + break; - c6 = 0; + } - } + } - let rtr = 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * at * c6; // stern resistance - let sapp = 0; - let mult = 0; - for ( let prop in this.appendices ) { + }; - sapp += this.appendices[ prop ].area; - mult += this.appendices[ prop ].coeff * this.appendices[ prop ].area; +} +// @ferrari212 +function Manoeuvring( ship, states, hullResistance, propellerInteraction, fuelConsumption, manoeuvring, rho = 1025 ) { - } + StateModule.call( this, ship, states ); + if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { - let k2; - if ( sapp !== 0 ) { + this.setDraft(); - k2 = mult / sapp; + } - } else { + if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state - k2 = 0; + this.setSpeed(); // use its design speed - } + } - let rapp = 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * sapp * k2 * this.coefficients.cf; // appendage resistance - let fn = this.coefficients.speedSI / Math.pow( this.g * this.floatState.LWL, 0.5 ); //Froude number + this.hullRes = hullResistance; + this.propellerInteraction = propellerInteraction; + this.fuelConsumption = fuelConsumption; + this.powerPlant = fuelConsumption.powerPlant; + this.manoeuvring = manoeuvring; + this.state = {}; + this.rho = propellerInteraction.rho; + this.propeller = this.propellerInteraction.propeller; + this.speedState = this.states.discrete.Speed.state; + this.floatState = this.states.discrete.FloatingCondition.state; + this.resistanceState = this.states.discrete.HullResistance.state; - let c7; - if ( this.floatState.BWL / this.floatState.LWL < 0.11 ) { + const YAW = manoeuvring.initial_yaw || 0; + const AN = manoeuvring.initial_angle || 0; + // The modules bellow use the value in knots for the ship speed, + // for the maneuvering model it is going to be used the values in SI (m/s). @ferrari212 + Object.assign( this.states, { + DX: { x: 0, y: 0, yaw: 0 }, + V: { u: 0, v: 0, yaw_dot: 0 }, + n: 0, + yaw: YAW, + rudderAngle: AN, + load: 0 + } ); - c7 = 0.229577 * Math.pow( this.floatState.BWL / this.floatState.LWL, 0.33333 ); + var engines = this.powerPlant.main.engines; + this.powerPlant.engCapac = []; + var engCapac = this.powerPlant.engCapac; - } else if ( this.floatState.BWL / this.floatState.LWL < 0.25 ) { + for ( var i = 0; i < engines.length; i ++ ) { - c7 = this.floatState.BWL / this.floatState.LWL; + engCapac[ i ] = engines[ i ].MCR; - } else { + } - c7 = 0.5 - 0.0625 * this.floatState.LWL / this.floatState.BWL; + this.totalCapac = engCapac.reduce( ( a, b ) => a + b, 0 ); - } + // The function simplify the resitence curve by Rt = k*u^2 + // the interpolation could be improved by other types of functions interporlation @ferrari212 + function intResist( man ) { - // calculate the half angle of entrance - let ie = 1 + 89 * Math.exp( - Math.pow( this.floatState.LWL / this.floatState.BWL, 0.80856 ) * Math.pow( 1 - this.floatState.Cwp, 0.30484 ) * Math.pow( 1 - this.floatState.Cp - 0.0225 * - ( this.coefficients.lcb / 100 ), 0.6367 ) * Math.pow( this.coefficients.lr / this.floatState.BWL, 0.34574 ) * Math.pow( 100 * ( this.floatState.Vs / Math.pow( this.floatState.LWL, 3 ) ), 0.16302 ) ); - let c1 = 2223105 * Math.pow( c7, 3.78613 ) * Math.pow( this.coefficients.T / this.floatState.BWL, 1.07961 ) * Math.pow( 90 - ie, - 1.37565 ); - let c5 = 1 - ( 0.8 * at ) / ( this.floatState.BWL * this.coefficients.T * this.floatState.Cm ); + var pow = Math.pow; - let c15; - if ( Math.pow( this.floatState.LWL, 3 ) / this.floatState.Vs < 512 ) { + const U = ( Boolean( man.states.calculationParameters.speed ) ) ? man.states.calculationParameters.speed : 10; - c15 = - 1.69385; + man.hullRes.setSpeed( U ); + const CONV = 0.5144447; + const R = man.hullRes.totalResistance.Rtadd; - } else if ( Math.pow( this.floatState.LWL, 3 ) / this.floatState.Vs < 1726.91 ) { + var k = R / ( Math.pow( U * CONV, 2 ) ); - c15 = - 1.69385 + ( this.floatState.LWL / Math.pow( this.floatState.Vs, 1 / 3 ) - 8 ) / 2.36; - } else { + var getRes = function ( u ) { - c15 = 0; + return k * ( pow( u, 2 ) ) * Math.sign( u ); - } + }; - let c16; - if ( this.floatState.Cp < 0.8 ) { + return getRes; - c16 = 8.07981 * this.floatState.Cp - 13.8673 * Math.pow( this.floatState.Cp, 2 ) + 6.984388 * Math.pow( this.floatState.Cp, 3 ); + } - } else { + this.getRes = intResist( this ); - c16 = 1.73014 - 0.7067 * this.floatState.Cp; + const W = ship.getWeight(); + this.m = manoeuvring.m || W.mass; - } + // The approximaxion is given by the inercia of an Elipsoid in water + var attributes = this.ship.structure.hull.attributes; + var T = this.ship.designState.calculationParameters.Draft_design; + var approxI = manoeuvring.I || Math.PI * rho * attributes.LOA * attributes.BOA * T * ( 4 * Math.pow( T, 2 ) + Math.pow( attributes.BOA, 2 ) ) / 120; - let m1 = 0.0140407 * ( this.floatState.LWL / this.coefficients.T ) - 1.75254 * ( ( Math.pow( this.floatState.Vs, 1 / 3 ) ) / this.floatState.LWL ) - 4.79323 * ( this.floatState.BWL / this.floatState.LWL ) - c16; + this.M_RB = manoeuvring.M || [ + [ this.m, 0, 0 ], + [ 0, this.m, 0 ], + [ 0, 0, approxI ] + ]; - let lambda; - if ( this.floatState.LWL / this.floatState.BWL > 12 ) { + this.output = [ "hydroCoeff", "dn" ]; - lambda = 1.446 * this.floatState.Cp - 0.36; + this.cacheDependence = [ "PropellerInteraction", "FloatingCondition" ]; + this.cache = {}; - } else { +} - lambda = 1.446 * this.floatState.Cp - 0.03 * ( this.floatState.LWL / this.floatState.BWL ); +Manoeuvring.prototype = Object.create( StateModule.prototype ); - } +Object.assign( Manoeuvring.prototype, { + constructor: Manoeuvring, + getPropResult: function ( n ) { - let c17 = 6919.3 * Math.pow( this.floatState.Cm, - 1.3346 ) * Math.pow( this.floatState.Vs / Math.pow( this.floatState.LWL, 3 ), 2.00977 ) * Math.pow( this.floatState.LWL / this.floatState.BWL - 2, 1.40692 ); - let m3 = - 7.2035 * Math.pow( this.floatState.BWL / this.floatState.LWL, 0.326869 ) * Math.pow( this.coefficients.T / this.floatState.BWL, 0.605375 ); - let m4_0_4 = c15 * 0.4 * Math.exp( - 0.034 * Math.pow( 0.4, - 3.29 ) ); - let rwa_0_4 = c1 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m1 * Math.pow( 0.4, - 0.9 ) + m4_0_4 * Math.cos( lambda * Math.pow( 0.4, - 2 ) ) ); - let m4_0_55 = c15 * 0.4 * Math.exp( - 0.034 * Math.pow( 0.55, - 3.29 ) ); - let rwa_0_55 = c17 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m3 * Math.pow( 0.55, - 0.9 ) + m4_0_55 * Math.cos( lambda * - Math.pow( 0.55, - 2 ) ) ); + if ( n === 0 ) return { Fp: 0, Pp: 0, cons: 0 }; - let m4, rwa, rwb, rwab; - if ( fn === 0 ) { + var Va = this.propellerInteraction.propulsion.Va; - m4 = 0; - rwa = 0; // wave resistance for Froude < 0.4 - rwb = 0; // wave resistance for Froude > 0.55 - rwab = 0; + var lcb = 100 * ( this.floatState.LCB - ( this.floatState.minXs + this.floatState.LWL / 2 ) ) / this.floatState.LWL; // % + var J = Math.abs( Va / ( n * this.propeller.D ) ); - } else { + var KT = this.propeller.beta1 - this.propeller.beta2 * J; + var KQ = this.propeller.gamma1 - this.propeller.gamma2 * J; - m4 = c15 * 0.4 * Math.exp( - 0.034 * Math.pow( fn, - 3.29 ) ); - rwa = c1 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m1 * Math.pow( fn, - 0.9 ) + m4 * Math.cos( lambda * Math.pow( fn, - 2 ) ) ); - rwb = c17 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m3 * Math.pow( fn, - 0.9 ) + m4 * Math.cos( lambda * Math.pow( fn, - 2 ) ) ); - rwab = rwa_0_4 + ( 10 * fn - 4 ) * ( rwa_0_55 - rwa_0_4 ) / 1.5; + var etar; + if ( this.propeller.noProps === 1 ) { - } + etar = 0.9922 - 0.05908 * this.propeller.AeAo + 0.07424 * ( this.floatState.Cp - 0.0225 * lcb ); - let rw; - if ( fn < 0.4 ) { + } else if ( this.propeller.noProps === 2 ) { - rw = rwa; + etar = 0.9737 + 0.111 * ( this.floatState.Cp - 0.0225 * lcb ) - 0.06325 * this.propeller.P / this.propeller.D; - } else if ( fn <= 0.55 ) { + } - rw = rwab; + var T = KT * this.rho * Math.pow( n, 2 ) * Math.pow( this.propeller.D, 4 ); + var Q = KQ * this.rho * Math.pow( n, 2 ) * Math.pow( this.propeller.D, 5 ); + // console.log( `T: ${T}; Q: ${Q}`); - } else { + var Fp = Math.sign( n ) * T * this.propeller.noProps * ( 1 - this.resistanceState.t ); + var Po = 2 * Math.PI * Math.abs( Q * n ) * this.propeller.noProps; + var Pp = Po * etar; - rw = rwb; + var cons = this.getFuelCons( Pp ); - } + return { Fp, Pp, cons }; - let fni = this.coefficients.speedSI / Math.sqrt( this.g * ( this.coefficients.Tfore - this.coefficients.hb - 0.25 * Math.pow( this.coefficients.abt, 0.5 ) ) + ( 0.15 * Math.pow( this.coefficients.speedSI, 2 ) ) ); - let pb = ( 0.56 * Math.pow( this.coefficients.abt, 0.5 ) ) / ( this.coefficients.Tfore - 1.5 * this.coefficients.hb ); + }, + getFuelCons: function ( Pp ) { - let rb; - if ( this.coefficients.abt === 0 ) { + // share load among engines in a system's array + function shareLoad( system, load ) { - rb = 0; + var triggerRatio = 0.8; // define loading rate at which next engine in the power system will be activated for sharing loads + var cons = 0; - } else { + var engCapac = []; + for ( var i = 0; i < system.engines.length; i ++ ) { - rb = ( 0.11 * Math.exp( - 3 * Math.pow( pb, - 2 ) ) * Math.pow( fni, 3 ) * Math.pow( this.coefficients.abt, 1.5 ) * this.rho * this.g ) / ( 1 + Math.pow( fni, 2 ) ); + engCapac[ i ] = system.engines[ i ].MCR; - } + } - let ra = 0.91 * 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * this.coefficients.wa * this.coefficients.ca; - if ( ( this.floatState.LWL / this.floatState.BWL <= 3.9 ) || ( this.floatState.LWL / this.floatState.BWL >= 15 ) ) { + if ( typeof system.etag === "number" ) { // diesel electrical system - console.error( "The L/B relation is not being respected. It should be 3.9 < L/B < 15, not" + " " + ( this.floatState.LWL / this.floatState.BWL ).toFixed( 2 ) + "." ); + load = load / ( system.etas * system.etag ); - } + } else { // diesel mechanical system - if ( ( this.floatState.BWL / this.coefficients.T <= 2.1 ) || ( this.floatState.BWL / this.coefficients.T >= 4 ) ) { + load = load / system.etas; // consumption rate in kg/s - console.error( "The B/T relation is not being respected. It should be 2.1 < B/T < 4, not" + " " + ( this.floatState.BWL / this.coefficients.T ).toFixed( 2 ) + "." ); + } - } + // distribute loads among engines + var totalCapac = engCapac.reduce( ( a, b ) => a + b, 0 ); + var partCapac = totalCapac - engCapac[ engCapac.length - 1 ]; + var loads = Array( engCapac.length ); + if ( load <= triggerRatio * partCapac ) { // if not all engines are loaded above trigger ratio, load them according to trigger rate ceil - if ( ( this.floatState.Cp <= 0.55 ) || ( this.floatState.Cp >= 0.85 ) ) { + var capSum = 0; + loads.fill( 0 ); + for ( var eng = 0; eng < engCapac.length; eng ++ ) { - console.error( "The prismatic coefficient is not being respected. It should be 0.55 < Cp < 0.85, not" + " " + this.floatState.Cp.toFixed( 2 ) + "." ); + capSum += engCapac[ eng ]; + if ( load <= triggerRatio * capSum ) { // if engines can support load - } + for ( i = 0; i <= eng; i ++ ) { // distribute load proportionally to engines' capacities - let Rt = this.coefficients.k * rf + rapp + rw + rb + rtr + ra; + loads[ i ] = load / capSum; + + } + + break; - return Rt; + } - }, "calmResistance" ), - totalResistance: StateModule.prototype.memoized( function () { + } - let Hw = 2 * this.wavCre.waveDef.waveAmplitude; // wave height + } else if ( triggerRatio * partCapac < load && load <= totalCapac ) { // if all engines are loaded above trigger ratio, make them all have same load % - let Rtadd; // N, total resistance including added wave resistance - if ( Hw <= 2 ) { // use Kreitner formula + loads.fill( load / totalCapac ); - let raddw = 0.64 * Math.pow( Hw * this.floatState.BWL, 2 ) * this.floatState.Cb * this.rho * this.g / this.floatState.LWL; - Rtadd = this.calmResistance + raddw; + } else if ( load > totalCapac ) { - } else { // add 20% sea margin + console.error( "Engines are overloaded. Power plant can't provide current required power." ); + loads.fill( 1 ); - Rtadd = 1.2 * this.calmResistance; + } - } + // calculate SFOC value for each activated engine + var SFOC; + for ( i = 0; i < loads.length; i ++ ) { - let Pe = this.coefficients.speedSI * Rtadd; // effective power + if ( loads[ i ] > 0 ) { // if engine is active - return { Rtadd, Pe }; + if ( system.engines[ i ].polOrder === 3 ) { - }, "totalResistance" ), - efficiency: StateModule.prototype.memoized( function () { + SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 3 ) + system.engines[ i ].b * Math.pow( loads[ i ], 2 ) + system.engines[ i ].c * loads[ i ] + system.engines[ i ].d; - let c8; - if ( this.floatState.BWL / this.coefficients.Taft < 5 ) { + } else if ( system.engines[ i ].polOrder === 2 ) { - c8 = this.floatState.BWL * this.coefficients.wa / ( this.floatState.LWL * this.propeller.D * this.coefficients.Taft ); + SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 2 ) + system.engines[ i ].b * loads[ i ] + system.engines[ i ].c; - } else { + } - c8 = this.coefficients.wa * ( 7 * this.floatState.BWL / this.coefficients.Taft - 25 ) / ( this.floatState.LWL * this.propeller.D * ( this.floatState.BWL / this.coefficients.Taft - 3 ) ); + cons += SFOC / ( 1000 ) * loads[ i ] * engCapac[ i ]; // consumption rate in kg/g } - let c9; - if ( c8 < 28 ) { + } - c9 = c8; + return cons; - } else { + } - c9 = 32 - 16 / ( c8 - 24 ); + var consumptionRate; - } + if ( typeof this.powerPlant.auxiliary === "object" ) { // calculate results for vessels which have main and auxiliary power systems - let c11; - if ( this.coefficients.Taft / this.propeller.D < 2 ) { + // change the propeller states for the maneuvering proppeller + consumptionRate = this.powerPlant.main.noSys * shareLoad( powerPlant.main, Pp / ( 1000 * this.powerPlant.main.noSys ) ); + consumptionRate += shareLoad( this.powerPlant.auxiliary, this.auxPowerState.Paux / 1000 ); - c11 = this.coefficients.Taft / this.propeller.D; + } else { // calculate results for vessels which have only one power system - } else { + consumptionRate = shareLoad( this.powerPlant.main, Pp / 1000 ); - c11 = 0.0833333 * Math.pow( this.coefficients.Taft / this.propeller.D, 3 ) + 1.33333; + } - } + return consumptionRate; - let c19; - if ( this.floatState.Cp < 0.7 ) { + } +} ); +Object.defineProperties( Manoeuvring.prototype, { + hydroCoeff: StateModule.prototype.memoized( function () { - c19 = 0.12997 / ( 0.95 - this.floatState.Cb ) - 0.11056 / ( 0.95 - this.floatState.Cp ); + var attributes = this.ship.structure.hull.attributes; + var state = this.states.discrete.FloatingCondition.state; + var calc = this.ship.designState.calculationParameters; - } else { + var L = attributes.LOA; + var D = attributes.Depth; + var B = attributes.BOA; - c19 = 0.18567 / ( 1.3571 - this.floatState.Cm ) - 0.71276 + 0.38648 * this.floatState.Cp; - } + var Cb = calc.Cb_design || state.Cb; + var Vs = state.Vs; + var T = calc.Draft_design; + var rho = this.rho; - let Cp1 = 1.45 * this.floatState.Cp - 0.315 - 0.0225 * this.coefficients.lcb; - let cv = this.coefficients.k * this.coefficients.cf + this.coefficients.ca; - let c20 = 1 + 0.015 * this.cstern; + var Vsdn = Vs / Math.pow( L, 3 ); + var delta_SR = 1 - 0.7 / ( 28.7 * Vsdn + 0.54 ); + var pow = Math.pow; - let w; // wake factor - if ( this.propeller.noProps === 1 ) { + const PI = Math.PI; + const ld = L / D; + const bl = B / L; + const bt = B / T; + const bls = pow( bl, 2 ); + const bts = pow( bt, 2 ); + const tls = pow( T / L, 2 ); - w = c9 * c20 * cv * this.floatState.LWL / this.coefficients.Taft * ( 0.050776 + 0.93405 * c11 * cv / ( 1 - Cp1 ) ) + 0.27915 * c20 * Math.pow( this.floatState.BWL / ( this.floatState.LWL * ( 1 - Cp1 ) ), 0.5 ) + c19 * c20; + // Clarke formulas + var Yvaccdn = - PI * tls * ( 1 + 0.16 * Cb * bt - 5.1 * bls ); + var Yraccdn = - PI * tls * ( 0.67 * bl - 0.0033 * bts ); + var Nvaccdn = - PI * tls * ( 1.1 * bl - 0.041 * bt ); + var Nraccdn = - PI * tls * ( 1 / 12 + 0.017 * Cb * bt - 0.33 * bl ); + var Yvacc = Yvaccdn * 0.5 * rho * pow( L, 3 ); + var Yracc = Yraccdn * 0.5 * rho * pow( L, 4 ); + var Nvacc = Nvaccdn * 0.5 * rho * pow( L, 4 ); + var Nracc = Nraccdn * 0.5 * rho * pow( L, 5 ); - } else if ( this.propeller.noProps === 2 ) { + // Lee formulas + var Yvdn = - ( 0.145 + 2.25 / ld - 0.2 * delta_SR ); + var mdn = this.m / ( 0.5 * rho * pow( L, 2 ) * D ); + var Yrdn = mdn - ( 0.282 + 0.1 * delta_SR ) + ( 0.0086 * delta_SR + 0.004 ) * ld; + var Nvdn = - ( 0.222 + 0.1 * delta_SR ) + 0.00484 * ld; + var Nrdn = - ( 0.0424 - 0.03 * delta_SR ) - ( 0.004 * delta_SR - 0.00027 ) * ld; - w = 0.3095 * this.floatState.Cb + 10 * cv * this.floatState.Cb - 0.23 * this.propeller.D / Math.pow( this.floatState.BWL * this.coefficients.T, 0.5 ); + return { Yvacc, Yracc, Nvacc, Nracc, Yvdn, Yrdn, Nvdn, Nrdn }; - } + }, "hydroCoeff" ), + dn: StateModule.prototype.memoized( function () { - let t; // thrust deduction factor - if ( this.propeller.noProps === 1 ) { + const L = this.ship.structure.hull.attributes.LOA; - t = 0.25014 * Math.pow( this.floatState.BWL / this.floatState.LWL, 0.28956 ) * Math.pow( Math.pow( this.floatState.BWL * this.coefficients.T, 0.5 ) / this.propeller.D, 0.2624 ) / - Math.pow( 1 - this.floatState.Cp + 0.0225 * this.coefficients.lcb, 0.01762 ) + 0.0015 * this.cstern; + var Cl = 0.5 * this.rho * Math.pow( L, 2 ); + var Cll = Cl * L; + var Clll = Cll * L; - } else if ( this.propeller.noProps === 2 ) { + return { Cl, Cll, Clll }; - t = 0.325 * this.floatState.Cb - 0.1885 * this.propeller.D / Math.pow( this.floatState.BWL * this.coefficients.T, 0.5 ); + }, "dn" ) +} ); +function FuelConsumption( ship, states, powerPlant ) { - } + StateModule.call( this, ship, states ); + this.propellerState = this.states.discrete.PropellerInteraction.state; - let etah = ( 1 - t ) / ( 1 - w ); // hull efficiency + this.setAuxPower = function ( Paux ) { - return { w, t, etah }; + if ( typeof Paux === "undefined" ) { - }, "efficiency" ) - } ); + Paux = 0; - } + } -} + if ( typeof this.states.discrete.AuxPower === "undefined" ) { // Ps and Paux in W each -class PropellerInteraction extends StateModule { + this.states.discrete.AuxPower = { + state: {}, + thisStateVer: 0 + }; - constructor( ship, states, propeller, rho = 1025 ) { + } - super( ship, states ); - this.propeller = propeller; + this.states.discrete.AuxPower.state.Paux = Paux; + this.states.discrete.AuxPower.thisStateVer ++; - if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { + }; - this.setDraft(); + if ( typeof this.states.discrete.AuxPower === "undefined" ) { // Ps and Paux in W each - } + this.setAuxPower( 0 ); - if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state + } - this.setSpeed(); // use its design speed + this.auxPowerState = this.states.discrete.AuxPower.state; - } + this.powerPlant = powerPlant; + this.output = [ "consumptionRate" ]; - this.speedState = this.states.discrete.Speed.state; - this.floatState = this.states.discrete.FloatingCondition.state; - this.resistanceState = this.states.discrete.HullResistance.state; - this.rho = rho; // kg/m³ - this.output = [ "propulsion" ]; + this.cacheDependence = [ "PropellerInteraction" ]; + this.cache = {}; - this.cacheDependence = [ "FloatingCondition", "Speed" ]; - this.cache = {}; +} - Object.defineProperties( this, { - propulsion: StateModule.prototype.memoized( function () { +FuelConsumption.prototype = Object.create( StateModule.prototype ); - // convert vessel speed from knots to m/s - if ( this.speedSI === 0 ) { +Object.assign( FuelConsumption.prototype, { + constructor: FuelConsumption +} ); - console.error( "Speed equals to zero, try getPropResult() method to get boolard pull or use changeSpeed() method to set a non null value." ); +Object.defineProperties( FuelConsumption.prototype, { + consumptionRate: StateModule.prototype.memoized( function () { // consumption rate in kg/s - } + // share load among engines in a system's array + function shareLoad( system, load ) { + + var triggerRatio = 0.8; // define loading rate at which next engine in the power system will be activated for sharing loads + var cons = 0; + + var engCapac = []; + for ( var i = 0; i < system.engines.length; i ++ ) { + + engCapac[ i ] = system.engines[ i ].MCR; + + } - var speedSI = 0.514444 * this.speedState.speed; - var lcb = 100 * ( this.floatState.LCB - ( this.floatState.minXs + this.floatState.LWL / 2 ) ) / this.floatState.LWL; // % - var Va = speedSI / ( 1 - this.resistanceState.w ); // m/s - var T = this.resistanceState.Rtadd / ( this.propeller.noProps * ( 1 - this.resistanceState.t ) ); // N, thrust + if ( typeof system.etag === "number" ) { // diesel electrical system - var acoeff = T / ( this.rho * Math.pow( this.propeller.D * Va, 2 ) ); - var bcoeff = this.propeller.beta2; - var ccoeff = - this.propeller.beta1; - var J = ( - bcoeff + Math.pow( Math.pow( bcoeff, 2 ) - 4 * acoeff * ccoeff, 0.5 ) ) / ( 2 * acoeff ); + load = load / ( system.etas * system.etag ); - var n = Va / ( J * this.propeller.D ); // rps - // var npm = 60*n; + } else { // diesel mechanical system - var KT = this.propeller.beta1 - this.propeller.beta2 * J; - var KQ = this.propeller.gamma1 - this.propeller.gamma2 * J; - var eta0 = J * KT / ( 2 * Math.PI * KQ ); + load = load / system.etas; // consumption rate in kg/s - var etar; - if ( this.propeller.noProps === 1 ) { + } - etar = 0.9922 - 0.05908 * this.propeller.AeAo + 0.07424 * ( this.floatState.Cp - 0.0225 * lcb ); + // distribute loads among engines + var totalCapac = engCapac.reduce( ( a, b ) => a + b, 0 ); + var partCapac = totalCapac - engCapac[ engCapac.length - 1 ]; + var loads = Array( engCapac.length ); + if ( load <= triggerRatio * partCapac ) { // if not all engines are loaded above trigger ratio, load them according to trigger rate ceil - } else if ( this.propeller.noProps === 2 ) { + var capSum = 0; + loads.fill( 0 ); + for ( var eng = 0; eng < engCapac.length; eng ++ ) { - etar = 0.9737 + 0.111 * ( this.floatState.Cp - 0.0225 * lcb ) - 0.06325 * this.propeller.P / this.propeller.D; + capSum += engCapac[ eng ]; + if ( load <= triggerRatio * capSum ) { // if engines can support load - } + for ( i = 0; i <= eng; i ++ ) { // distribute load proportionally to engines' capacities - var eta = eta0 * this.resistanceState.etah * etar; - var Ps = this.resistanceState.Pe / eta; // W, required brake power + loads[ i ] = load / capSum; - return { eta, Ps, n, Va }; + } - }, "propulsion" ) + break; - } ); + } - } + } -} + } else if ( triggerRatio * partCapac < load && load <= totalCapac ) { // if all engines are loaded above trigger ratio, make them all have same load % -//@EliasHasle + loads.fill( load / totalCapac ); -//Very simple download of the specification of a given ship design. Depends on a working getSpecification method. + } else if ( load > totalCapac ) { -function downloadShip( ship ) { + console.error( "Engines are overloaded. Power plant can't provide current required power." ); + loads.fill( 1 ); - // TODO: Add the possibility to choose the json name and return the link metadata. + } - let specification = ship.getSpecification(); - let output = JSON.stringify( specification ); - let link = document.createElement( "a" ); - link.href = "data:application/json," + encodeURIComponent( output ); - link.download = "shipdesignspecification.json"; - link.target = "_blank"; - link.click(); + // calculate SFOC value for each activated engine + var SFOC; + for ( i = 0; i < loads.length; i ++ ) { -} + if ( loads[ i ] > 0 ) { // if engine is active -class FuelConsumption extends StateModule { + if ( system.engines[ i ].polOrder === 3 ) { - constructor( ship, states, powerPlant ) { + SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 3 ) + system.engines[ i ].b * Math.pow( loads[ i ], 2 ) + system.engines[ i ].c * loads[ i ] + system.engines[ i ].d; - super( ship, states ); + } else if ( system.engines[ i ].polOrder === 2 ) { - this.propellerState = this.states.discrete.PropellerInteraction.state; + SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 2 ) + system.engines[ i ].b * loads[ i ] + system.engines[ i ].c; - this.setAuxPower = function ( Paux ) { + } - if ( typeof Paux === "undefined" ) { + cons += SFOC / ( 1000 * 3600 ) * loads[ i ] * engCapac[ i ]; // consumption rate in kg/s - Paux = 0; + } } - if ( typeof this.states.discrete.AuxPower === "undefined" ) { // Ps and Paux in W each - - this.states.discrete.AuxPower = { - state: {}, - thisStateVer: 0 - }; + return cons; - } + } - this.states.discrete.AuxPower.state.Paux = Paux; - this.states.discrete.AuxPower.thisStateVer ++; + var consumptionRate; + if ( typeof this.powerPlant.auxiliary === "object" ) { // calculate results for vessels which have main and auxiliary power systems - }; + consumptionRate = this.powerPlant.main.noSys * shareLoad( this.powerPlant.main, this.propellerState.Ps / ( 1000 * this.powerPlant.main.noSys ) ); + consumptionRate += shareLoad( this.powerPlant.auxiliary, this.auxPowerState.Paux / 1000 ); - if ( typeof this.states.discrete.AuxPower === "undefined" ) { // Ps and Paux in W each + } else { // calculate results for vessels which have only one power system - this.setAuxPower( 0 ); + consumptionRate = shareLoad( this.powerPlant.main, ( this.propellerState.Ps + this.auxPowerState.Paux ) / 1000 ); } - this.auxPowerState = this.states.discrete.AuxPower.state; + return consumptionRate; - this.powerPlant = powerPlant; - this.output = [ "consumptionRate" ]; + } ) +}, "consumptionRate" ); +// partially adapted from http://www.shiplab.ntnu.co/app/holtrop/ - this.cacheDependence = [ "PropellerInteraction" ]; - this.cache = {}; +function HullResistance( ship, states, propeller, wavCre, g = 9.81, rho = 1025, mi = 0.00122 ) { - Object.defineProperties( this, { + StateModule.call( this, ship, states ); + this.propeller = propeller; + if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { - consumptionRate: StateModule.prototype.memoized( function () { // consumption rate in kg/s + this.setDraft(); - // share load among engines in a system's array - function shareLoad( system, load ) { + } - var triggerRatio = 0.8; // define loading rate at which next engine in the power system will be activated for sharing loads - var cons = 0; + if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state - var engCapac = []; - for ( var i = 0; i < system.engines.length; i ++ ) { + this.setSpeed(); // use its design speed - engCapac[ i ] = system.engines[ i ].MCR; + } - } + this.speedState = this.states.discrete.Speed.state; + this.floatState = this.states.discrete.FloatingCondition.state; + this.wavCre = wavCre; + this.g = g; + this.rho = rho; + this.mi = mi; // dynamic viscosity + this.b = this.ship.structure.hull.attributes.bulb; // has a bulb? Boolean. + this.tr = this.ship.structure.hull.attributes.transom; // transom. Boolean. + this.cstern = this.ship.structure.hull.attributes.cstern; // afterbody form. + // Pram with Gondola = -25, V-Shaped Sections = -10, Normal Section Shape = 0, U-Shaped Sections with Hognes Stern = 10 + this.appendices = this.ship.structure.hull.attributes.appendices; // appendices information + // skegRudder has coeff from 1.5 to 2.0 + // sternRudder has coeff from 1.3 to 1.5 + // twinScrewBalanceRudder has coeff 2.8 + // shaftBrackets has coeff 3.0 + // skeg has coeff from 1.5 to 2.0 + // strutBossings has coeff 3.0 + // hullBossings has coeff 2.0 + // shafts have coeff from 2 to 4 + // stabilizerFins has coeff 2.8 + // dome has coeff 2.7 + // bilgeKeel has coeff 1.4 + this.output = [ "totalResistance", "efficiency" ]; - if ( typeof system.etag === "number" ) { // diesel electrical system + this.cacheDependence = [ "FloatingCondition", "Speed" ]; + this.cache = {}; - load = load / ( system.etas * system.etag ); +} - } else { // diesel mechanical system +HullResistance.prototype = Object.create( StateModule.prototype ); - load = load / system.etas; // consumption rate in kg/s +Object.assign( HullResistance.prototype, { + constructor: HullResistance +} ); - } +Object.defineProperties( HullResistance.prototype, { + coefficients: StateModule.prototype.memoized( function () { - // distribute loads among engines - var totalCapac = engCapac.reduce( ( a, b ) => a + b, 0 ); - var partCapac = totalCapac - engCapac[ engCapac.length - 1 ]; - var loads = Array( engCapac.length ); - if ( load <= triggerRatio * partCapac ) { // if not all engines are loaded above trigger ratio, load them according to trigger rate ceil + var lcb = 100 * ( this.floatState.LCB - ( this.floatState.minXs + this.floatState.LWL / 2 ) ) / this.floatState.LWL; // % - var capSum = 0; - loads.fill( 0 ); - for ( var eng = 0; eng < engCapac.length; eng ++ ) { + var Tfore; + if ( this.floatState.draftfp === null ) { - capSum += engCapac[ eng ]; - if ( load <= triggerRatio * capSum ) { // if engines can support load + Tfore = this.floatState.T; - for ( i = 0; i <= eng; i ++ ) { // distribute load proportionally to engines' capacities + } else { - loads[ i ] = load / capSum; + Tfore = this.floatState.draftfp; - } + } - break; + var Taft; + if ( this.floatState.draftap === null ) { - } + Taft = this.floatState.T; - } + } else { + + Taft = this.floatState.draftap; - } else if ( triggerRatio * partCapac < load && load <= totalCapac ) { // if all engines are loaded above trigger ratio, make them all have same load % + } - loads.fill( load / totalCapac ); + var T = ( Tfore + Taft ) / 2; // m, average draft + var hb = Tfore / 2; + var abt = Math.PI * Math.pow( Tfore / 2, 2 ) * this.b / 7.7; // transverse sectional bulb area + var c3 = 0.56 * ( Math.pow( abt, 1.5 ) ) / ( this.floatState.BWL * T * ( 0.31 * Math.pow( abt, 0.5 ) + Tfore - hb ) ); + var c2 = Math.exp( - 1.89 * Math.pow( c3, 0.5 ) ); - } else if ( load > totalCapac ) { + var c4; + if ( Tfore / this.floatState.LWL > 0.04 ) { - console.error( "Engines are overloaded. Power plant can't provide current required power." ); - loads.fill( 1 ); + c4 = 0.04; - } + } else { - // calculate SFOC value for each activated engine - var SFOC; - for ( i = 0; i < loads.length; i ++ ) { + c4 = Tfore / this.floatState.LWL; - if ( loads[ i ] > 0 ) { // if engine is active + } - if ( system.engines[ i ].polOrder === 3 ) { + // correlation allowance coefficient + var ca = 0.006 * Math.pow( this.floatState.LWL + 100, - 0.16 ) - 0.00205 + 0.003 * Math.pow( this.floatState.LWL / 7.5, 0.5 ) * Math.pow( this.floatState.Cb, 4 ) * c2 * ( 0.04 - c4 ); + var wa = this.floatState.LWL * ( 2 * T + this.floatState.BWL ) * Math.pow( this.floatState.Cm, 0.5 ) * ( 0.453 + 0.4425 * this.floatState.Cb - 0.2862 * this.floatState.Cm - 0.003467 * + this.floatState.BWL / T + 0.3696 * this.floatState.Cwp ) + 2.38 * abt / this.floatState.Cb; // wetted area - SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 3 ) + system.engines[ i ].b * Math.pow( loads[ i ], 2 ) + system.engines[ i ].c * loads[ i ] + system.engines[ i ].d; + var lr = this.floatState.LWL * ( 1 - this.floatState.Cp + ( 0.06 * this.floatState.Cp * ( lcb / 100 ) / ( 4 * this.floatState.Cp - 1 ) ) ); + var c14 = 1 + 0.011 * this.cstern; + var k = 0.93 + ( 0.487118 * c14 * Math.pow( this.floatState.BWL / this.floatState.LWL, 1.06806 ) * Math.pow( T / this.floatState.LWL, 0.46106 ) * Math.pow( this.floatState.LWL / + lr, 0.121563 ) * Math.pow( Math.pow( this.floatState.LWL, 3 ) / this.floatState.Vs, 0.36486 ) * Math.pow( 1 - this.floatState.Cp, - 0.604247 ) ); // form factor - } else if ( system.engines[ i ].polOrder === 2 ) { + var speedSI = 0.514444 * this.speedState.speed; // convert the speed from knots to m/s + var re = this.rho * this.floatState.LWL * speedSI / this.mi; // Reynolds number + var cf = 0.075 / Math.pow( ( Math.log( re ) / Math.log( 10 ) ) - 2, 2 ); // frictional coefficient - SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 2 ) + system.engines[ i ].b * loads[ i ] + system.engines[ i ].c; + return { lcb, Tfore, Taft, T, hb, c2, ca, abt, wa, lr, k, speedSI, cf }; - } + }, "coefficients" ), + calmResistance: StateModule.prototype.memoized( function () { // N, total hull resistance in calm waters - cons += SFOC / ( 1000 * 3600 ) * loads[ i ] * engCapac[ i ]; // consumption rate in kg/s + var at = 0.95 * ( this.coefficients.Taft - this.coefficients.Taft * 0.9225 ) * this.floatState.BWL * 0.89 * this.tr; // transom stern area + var rf = 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * this.coefficients.wa * this.coefficients.cf; // frictional resistance - } + var fnt; + if ( at === 0 ) { - } + fnt = 0; - return cons; + } else { - } + fnt = this.coefficients.speedSI / ( Math.pow( 2 * this.g * at / ( this.floatState.BWL + this.floatState.BWL * this.floatState.Cwp ), 0.5 ) ); - var consumptionRate; - if ( typeof this.powerPlant.auxiliary === "object" ) { // calculate results for vessels which have main and auxiliary power systems + } - consumptionRate = this.powerPlant.main.noSys * shareLoad( this.powerPlant.main, this.propellerState.Ps / ( 1000 * this.powerPlant.main.noSys ) ); - consumptionRate += shareLoad( this.powerPlant.auxiliary, this.auxPowerState.Paux / 1000 ); + var c6; + if ( fnt < 5 ) { - } else { // calculate results for vessels which have only one power system + c6 = 0.2 * ( 1 - 0.2 * fnt ); - consumptionRate = shareLoad( this.powerPlant.main, ( this.propellerState.Ps + this.auxPowerState.Paux ) / 1000 ); + } else { - } + c6 = 0; - return consumptionRate; + } - }, "consumptionRate" ) + var rtr = 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * at * c6; // stern resistance + var sapp = 0; + var mult = 0; + for ( var prop in this.appendices ) { - } ); + sapp += this.appendices[ prop ].area; + mult += this.appendices[ prop ].coeff * this.appendices[ prop ].area; - } + } -} + var k2; + if ( sapp !== 0 ) { -class Positioning { + k2 = mult / sapp; - constructor( ship, states, path ) { + } else { - this.ship = ship; - this.states = states; + k2 = 0; - this.routeData = {}; - this.routeData.pathVec = []; - this.routeData.unitPath = []; - this.routeData.heading = []; - this.routeData.totalDist = 0; - this.routeData.legDistance = []; - for ( var leg = 0; leg < path.length - 1; leg ++ ) { + } - this.routeData.pathVec[ leg ] = path[ leg + 1 ].map( ( num, idx ) => num - path[ leg ][ idx ] ); - this.routeData.legDistance[ leg ] = Math.sqrt( this.routeData.pathVec[ leg ].map( ( num ) => Math.pow( num, 2 ) ).reduce( ( num1, num2 ) => num1 + num2 ) ); - this.routeData.unitPath[ leg ] = this.routeData.pathVec[ leg ].map( ( num ) => num / this.routeData.legDistance[ leg ] ); + var rapp = 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * sapp * k2 * this.coefficients.cf; // appendage resistance + var fn = this.coefficients.speedSI / Math.pow( this.g * this.floatState.LWL, 0.5 ); //Froude number - // get heading in relation to North/y axis - var heading = Math.acos( this.routeData.pathVec[ leg ][ 1 ] / this.routeData.legDistance[ leg ] ); - heading *= 180 / Math.PI; // convert to degrees + var c7; + if ( this.floatState.BWL / this.floatState.LWL < 0.11 ) { - if ( this.routeData.pathVec[ leg ][ 0 ] < 0 ) { + c7 = 0.229577 * Math.pow( this.floatState.BWL / this.floatState.LWL, 0.33333 ); - heading = 360 - heading; + } else if ( this.floatState.BWL / this.floatState.LWL < 0.25 ) { - } + c7 = this.floatState.BWL / this.floatState.LWL; - this.routeData.heading[ leg ] = heading; + } else { - this.routeData.totalDist += this.routeData.legDistance[ leg ]; + c7 = 0.5 - 0.0625 * this.floatState.LWL / this.floatState.BWL; } - // initialize vessel on path - this.states.continuous.Positioning = {}; - this.states.continuous.Positioning.position = path[ 0 ]; - this.states.continuous.Positioning.travelLegDist = 0; - this.states.continuous.Positioning.travelDist = 0; - this.positionState = this.states.continuous.Positioning; + // calculate the half angle of entrance + var ie = 1 + 89 * Math.exp( - Math.pow( this.floatState.LWL / this.floatState.BWL, 0.80856 ) * Math.pow( 1 - this.floatState.Cwp, 0.30484 ) * Math.pow( 1 - this.floatState.Cp - 0.0225 * + ( this.coefficients.lcb / 100 ), 0.6367 ) * Math.pow( this.coefficients.lr / this.floatState.BWL, 0.34574 ) * Math.pow( 100 * ( this.floatState.Vs / Math.pow( this.floatState.LWL, 3 ) ), 0.16302 ) ); + var c1 = 2223105 * Math.pow( c7, 3.78613 ) * Math.pow( this.coefficients.T / this.floatState.BWL, 1.07961 ) * Math.pow( 90 - ie, - 1.37565 ); + var c5 = 1 - ( 0.8 * at ) / ( this.floatState.BWL * this.coefficients.T * this.floatState.Cm ); - this.states.discrete.Leg = { - state: { - leg: 0 - }, - thisStateVer: 1 - }; - this.legState = this.states.discrete.Leg.state; + var c15; + if ( Math.pow( this.floatState.LWL, 3 ) / this.floatState.Vs < 512 ) { - if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state + c15 = - 1.69385; - StateModule.prototype.setSpeed.call( this ); // use its design speed + } else if ( Math.pow( this.floatState.LWL, 3 ) / this.floatState.Vs < 1726.91 ) { - } + c15 = - 1.69385 + ( this.floatState.LWL / Math.pow( this.floatState.Vs, 1 / 3 ) - 8 ) / 2.36; - if ( typeof this.states.discrete.Heading === "undefined" ) { + } else { - StateModule.prototype.setHeading.call( this, this.routeData.heading[ 0 ] ); + c15 = 0; } - this.advanceShip = function ( timeStep ) { // calculate advanced distance during one time step + var c16; + if ( this.floatState.Cp < 0.8 ) { + + c16 = 8.07981 * this.floatState.Cp - 13.8673 * Math.pow( this.floatState.Cp, 2 ) + 6.984388 * Math.pow( this.floatState.Cp, 3 ); + + } else { - var remVec, remDist; - var advDist = timeStep * 1 / 3600 * this.states.discrete.Speed.state.speed; + c16 = 1.73014 - 0.7067 * this.floatState.Cp; - while ( 0 < advDist ) { + } - remVec = path[ this.legState.leg + 1 ].map( ( num, idx ) => num - this.positionState.position[ idx ] ); - remDist = Math.sqrt( remVec.map( ( num ) => Math.pow( num, 2 ) ).reduce( ( num1, num2 ) => num1 + num2 ) ); - if ( advDist <= remDist ) { + var m1 = 0.0140407 * ( this.floatState.LWL / this.coefficients.T ) - 1.75254 * ( ( Math.pow( this.floatState.Vs, 1 / 3 ) ) / this.floatState.LWL ) - 4.79323 * ( this.floatState.BWL / this.floatState.LWL ) - c16; - this.positionState.position = this.positionState.position.map( ( num, idx ) => num + advDist * this.routeData.unitPath[ this.legState.leg ][ idx ] ); + var lambda; + if ( this.floatState.LWL / this.floatState.BWL > 12 ) { - // add to traveled distance - this.positionState.travelLegDist = this.positionState.travelLegDist + advDist; - this.positionState.travelDist = this.positionState.travelDist + advDist; + lambda = 1.446 * this.floatState.Cp - 0.36; - advDist = 0; + } else { - } else if ( path[ this.legState.leg + 2 ] !== undefined ) { // trip has another leg + lambda = 1.446 * this.floatState.Cp - 0.03 * ( this.floatState.LWL / this.floatState.BWL ); - // change direction and continue sailing - advDist -= remDist; - this.positionState.position = path[ this.legState.leg + 1 ]; + } - // add to traveled distance - this.positionState.travelLegDist = 0; - this.positionState.travelDist = this.positionState.travelDist + remDist; + var c17 = 6919.3 * Math.pow( this.floatState.Cm, - 1.3346 ) * Math.pow( this.floatState.Vs / Math.pow( this.floatState.LWL, 3 ), 2.00977 ) * Math.pow( this.floatState.LWL / this.floatState.BWL - 2, 1.40692 ); + var m3 = - 7.2035 * Math.pow( this.floatState.BWL / this.floatState.LWL, 0.326869 ) * Math.pow( this.coefficients.T / this.floatState.BWL, 0.605375 ); + var m4_0_4 = c15 * 0.4 * Math.exp( - 0.034 * Math.pow( 0.4, - 3.29 ) ); + var rwa_0_4 = c1 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m1 * Math.pow( 0.4, - 0.9 ) + m4_0_4 * Math.cos( lambda * Math.pow( 0.4, - 2 ) ) ); + var m4_0_55 = c15 * 0.4 * Math.exp( - 0.034 * Math.pow( 0.55, - 3.29 ) ); + var rwa_0_55 = c17 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m3 * Math.pow( 0.55, - 0.9 ) + m4_0_55 * Math.cos( lambda * + Math.pow( 0.55, - 2 ) ) ); - this.legState.leg ++; - this.states.discrete.Leg.thisStateVer ++; + var m4, rwa, rwb, rwab; + if ( fn === 0 ) { - StateModule.prototype.setHeading.call( this, this.routeData.heading[ this.legState.leg ] ); - console.log( "Vessel reached pivot point in navigation and entered leg " + this.legState.leg + "." ); + m4 = 0; + rwa = 0; // wave resistance for Froude < 0.4 + rwb = 0; // wave resistance for Froude > 0.55 + rwab = 0; - } else { + } else { - this.positionState.position = this.positionState.position.map( ( num, idx ) => num + advDist * this.routeData.unitPath[ this.legState.leg ][ idx ] ); + m4 = c15 * 0.4 * Math.exp( - 0.034 * Math.pow( fn, - 3.29 ) ); + rwa = c1 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m1 * Math.pow( fn, - 0.9 ) + m4 * Math.cos( lambda * Math.pow( fn, - 2 ) ) ); + rwb = c17 * this.coefficients.c2 * c5 * this.floatState.Vs * this.rho * this.g * Math.exp( m3 * Math.pow( fn, - 0.9 ) + m4 * Math.cos( lambda * Math.pow( fn, - 2 ) ) ); + rwab = rwa_0_4 + ( 10 * fn - 4 ) * ( rwa_0_55 - rwa_0_4 ) / 1.5; - // add to traveled distance - this.positionState.travelLegDist = this.positionState.travelLegDist + advDist; - this.positionState.travelDist = this.positionState.travelDist + advDist; + } - console.log( "Vessel reached final destination." ); - break; + var rw; + if ( fn < 0.4 ) { - } + rw = rwa; - } + } else if ( fn <= 0.55 ) { - }; + rw = rwab; - } + } else { -} + rw = rwb; -// @ferrari212 + } -class Manoeuver extends StateModule { + var fni = this.coefficients.speedSI / Math.sqrt( this.g * ( this.coefficients.Tfore - this.coefficients.hb - 0.25 * Math.pow( this.coefficients.abt, 0.5 ) ) + ( 0.15 * Math.pow( this.coefficients.speedSI, 2 ) ) ); + var pb = ( 0.56 * Math.pow( this.coefficients.abt, 0.5 ) ) / ( this.coefficients.Tfore - 1.5 * this.coefficients.hb ); - constructor( ship, states, hullResistance, propellerInteraction, fuelConsumption, manoeuvring, rho = 1025 ) { + var rb; + if ( this.coefficients.abt === 0 ) { - super( ship, states ); + rb = 0; - if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { + } else { - this.setDraft(); + rb = ( 0.11 * Math.exp( - 3 * Math.pow( pb, - 2 ) ) * Math.pow( fni, 3 ) * Math.pow( this.coefficients.abt, 1.5 ) * this.rho * this.g ) / ( 1 + Math.pow( fni, 2 ) ); } - if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state + var ra = 0.91 * 0.5 * this.rho * Math.pow( this.coefficients.speedSI, 2 ) * this.coefficients.wa * this.coefficients.ca; + if ( ( this.floatState.LWL / this.floatState.BWL <= 3.9 ) || ( this.floatState.LWL / this.floatState.BWL >= 15 ) ) { - this.setSpeed(); // use its design speed + console.error( "The L/B relation is not being respected. It should be 3.9 < L/B < 15, not" + " " + ( this.floatState.LWL / this.floatState.BWL ).toFixed( 2 ) + "." ); } - this.hullRes = hullResistance; - this.propellerInteraction = propellerInteraction; - this.fuelConsumption = fuelConsumption; - this.powerPlant = fuelConsumption.powerPlant; - this.manoeuvring = manoeuvring; - this.state = {}; - this.rho = propellerInteraction.rho; - this.propeller = this.propellerInteraction.propeller; - this.speedState = this.states.discrete.Speed.state; - this.floatState = this.states.discrete.FloatingCondition.state; - this.resistanceState = this.states.discrete.HullResistance.state; + if ( ( this.floatState.BWL / this.coefficients.T <= 2.1 ) || ( this.floatState.BWL / this.coefficients.T >= 4 ) ) { - const YAW = manoeuvring.initial_yaw || 0; - const AN = manoeuvring.initial_angle || 0; - // The modules bellow use the value in knots for the ship speed, - // for the maneuvering model it is going to be used the values in SI (m/s). @ferrari212 - Object.assign( this.states, { - DX: { x: 0, y: 0, yaw: 0 }, - V: { u: 0, v: 0, yaw_dot: 0 }, - n: 0, - yaw: YAW, - rudderAngle: AN, - load: 0 - } ); + console.error( "The B/T relation is not being respected. It should be 2.1 < B/T < 4, not" + " " + ( this.floatState.BWL / this.coefficients.T ).toFixed( 2 ) + "." ); - var engines = this.powerPlant.main.engines; - this.powerPlant.engCapac = []; - var engCapac = this.powerPlant.engCapac; + } - for ( var i = 0; i < engines.length; i ++ ) { + if ( ( this.floatState.Cp <= 0.55 ) || ( this.floatState.Cp >= 0.85 ) ) { - engCapac[ i ] = engines[ i ].MCR; + console.error( "The prismatic coefficient is not being respected. It should be 0.55 < Cp < 0.85, not" + " " + this.floatState.Cp.toFixed( 2 ) + "." ); } - this.totalCapac = engCapac.reduce( ( a, b ) => a + b, 0 ); - - const W = ship.getWeight(); - this.m = manoeuvring.m || W.mass; + var Rt = this.coefficients.k * rf + rapp + rw + rb + rtr + ra; - // The approximation is given by the inertia of an Ellipsoid in water - var attributes = this.ship.structure.hull.attributes; - var T = this.ship.designState.calculationParameters.Draft_design; - var approxI = manoeuvring.I || Math.PI * rho * attributes.LOA * attributes.BOA * T * ( 4 * Math.pow( T, 2 ) + Math.pow( attributes.BOA, 2 ) ) / 120; + return Rt; - this.M_RB = manoeuvring.M || [ - [ this.m, 0, 0 ], - [ 0, this.m, 0 ], - [ 0, 0, approxI ] - ]; + }, "calmResistance" ), + totalResistance: StateModule.prototype.memoized( function () { - this.output = [ "hydroCoeff", "dn" ]; + var Hw = 2 * this.wavCre.waveDef.waveAmplitude; // wave height - this.cacheDependence = [ "PropellerInteraction", "FloatingCondition" ]; - this.cache = {}; + var Rtadd; // N, total resistance including added wave resistance + if ( Hw <= 2 ) { // use Kreitner formula - Object.defineProperties( this, { - hydroCoeff: StateModule.prototype.memoized( function () { + var raddw = 0.64 * Math.pow( Hw * this.floatState.BWL, 2 ) * this.floatState.Cb * this.rho * this.g / this.floatState.LWL; + Rtadd = this.calmResistance + raddw; - var attributes = this.ship.structure.hull.attributes; - var state = this.states.discrete.FloatingCondition.state; - var calc = this.ship.designState.calculationParameters; + } else { // add 20% sea margin - var L = attributes.LOA; - var D = attributes.Depth; - var B = attributes.BOA; + Rtadd = 1.2 * this.calmResistance; + } - var Cb = calc.Cb_design || state.Cb; - var Vs = state.Vs; - var T = calc.Draft_design; - var rho = this.rho; + var Pe = this.coefficients.speedSI * Rtadd; // effective power - var Vsdn = Vs / Math.pow( L, 3 ); - var delta_SR = 1 - 0.7 / ( 28.7 * Vsdn + 0.54 ); - var pow = Math.pow; + return { Rtadd, Pe }; - const PI = Math.PI; - const ld = L / D; - const bl = B / L; - const bt = B / T; - const bls = pow( bl, 2 ); - const bts = pow( bt, 2 ); - const tls = pow( T / L, 2 ); + }, "totalResistance" ), + efficiency: StateModule.prototype.memoized( function () { - // Clarke formulas - var Yvaccdn = - PI * tls * ( 1 + 0.16 * Cb * bt - 5.1 * bls ); - var Yraccdn = - PI * tls * ( 0.67 * bl - 0.0033 * bts ); - var Nvaccdn = - PI * tls * ( 1.1 * bl - 0.041 * bt ); - var Nraccdn = - PI * tls * ( 1 / 12 + 0.017 * Cb * bt - 0.33 * bl ); - var Yvacc = Yvaccdn * 0.5 * rho * pow( L, 3 ); - var Yracc = Yraccdn * 0.5 * rho * pow( L, 4 ); - var Nvacc = Nvaccdn * 0.5 * rho * pow( L, 4 ); - var Nracc = Nraccdn * 0.5 * rho * pow( L, 5 ); + var c8; + if ( this.floatState.BWL / this.coefficients.Taft < 5 ) { - // Lee formulas - var Yvdn = - ( 0.145 + 2.25 / ld - 0.2 * delta_SR ); - var mdn = this.m / ( 0.5 * rho * pow( L, 2 ) * D ); - var Yrdn = mdn - ( 0.282 + 0.1 * delta_SR ) + ( 0.0086 * delta_SR + 0.004 ) * ld; - var Nvdn = - ( 0.222 + 0.1 * delta_SR ) + 0.00484 * ld; - var Nrdn = - ( 0.0424 - 0.03 * delta_SR ) - ( 0.004 * delta_SR - 0.00027 ) * ld; + c8 = this.floatState.BWL * this.coefficients.wa / ( this.floatState.LWL * this.propeller.D * this.coefficients.Taft ); - return { Yvacc, Yracc, Nvacc, Nracc, Yvdn, Yrdn, Nvdn, Nrdn }; + } else { - }, "hydroCoeff" ), - dn: StateModule.prototype.memoized( function () { + c8 = this.coefficients.wa * ( 7 * this.floatState.BWL / this.coefficients.Taft - 25 ) / ( this.floatState.LWL * this.propeller.D * ( this.floatState.BWL / this.coefficients.Taft - 3 ) ); - const L = this.ship.structure.hull.attributes.LOA; + } - var Cl = 0.5 * this.rho * Math.pow( L, 2 ); - var Cll = Cl * L; - var Clll = Cll * L; + var c9; + if ( c8 < 28 ) { - return { Cl, Cll, Clll }; + c9 = c8; - }, "dn" ) - } ); + } else { - } + c9 = 32 - 16 / ( c8 - 24 ); + } - // The function simplify the resistance curve by Rt = k*u^2 - // the interpolation could be improved by other types of functions interpolation @ferrari212 - getRes( man ) { + var c11; + if ( this.coefficients.Taft / this.propeller.D < 2 ) { - let pow = Math.pow; + c11 = this.coefficients.Taft / this.propeller.D; - const U = ( Boolean( man.states.calculationParameters.speed ) ) ? man.states.calculationParameters.speed : 10; + } else { - man.hullRes.setSpeed( U ); - const CONV = 0.5144447; - const R = man.hullRes.totalResistance.Rtadd; + c11 = 0.0833333 * Math.pow( this.coefficients.Taft / this.propeller.D, 3 ) + 1.33333; - let k = R / ( Math.pow( U * CONV, 2 ) ); + } + var c19; + if ( this.floatState.Cp < 0.7 ) { - let getRes = function ( u ) { + c19 = 0.12997 / ( 0.95 - this.floatState.Cb ) - 0.11056 / ( 0.95 - this.floatState.Cp ); - return k * ( pow( u, 2 ) ) * Math.sign( u ); + } else { - }; + c19 = 0.18567 / ( 1.3571 - this.floatState.Cm ) - 0.71276 + 0.38648 * this.floatState.Cp; - return getRes; + } - } + var Cp1 = 1.45 * this.floatState.Cp - 0.315 - 0.0225 * this.coefficients.lcb; + var cv = this.coefficients.k * this.coefficients.cf + this.coefficients.ca; + var c20 = 1 + 0.015 * this.cstern; - getPropResult( n ) { + var w; // wake factor + if ( this.propeller.noProps === 1 ) { - if ( n === 0 ) return { Fp: 0, Pp: 0, cons: 0 }; + w = c9 * c20 * cv * this.floatState.LWL / this.coefficients.Taft * ( 0.050776 + 0.93405 * c11 * cv / ( 1 - Cp1 ) ) + 0.27915 * c20 * Math.pow( this.floatState.BWL / ( this.floatState.LWL * ( 1 - Cp1 ) ), 0.5 ) + c19 * c20; - var Va = this.propellerInteraction.propulsion.Va; + } else if ( this.propeller.noProps === 2 ) { - var lcb = 100 * ( this.floatState.LCB - ( this.floatState.minXs + this.floatState.LWL / 2 ) ) / this.floatState.LWL; // % - var J = Math.abs( Va / ( n * this.propeller.D ) ); + w = 0.3095 * this.floatState.Cb + 10 * cv * this.floatState.Cb - 0.23 * this.propeller.D / Math.pow( this.floatState.BWL * this.coefficients.T, 0.5 ); - var KT = this.propeller.beta1 - this.propeller.beta2 * J; - var KQ = this.propeller.gamma1 - this.propeller.gamma2 * J; + } - var etar; + var t; // thrust deduction factor if ( this.propeller.noProps === 1 ) { - etar = 0.9922 - 0.05908 * this.propeller.AeAo + 0.07424 * ( this.floatState.Cp - 0.0225 * lcb ); + t = 0.25014 * Math.pow( this.floatState.BWL / this.floatState.LWL, 0.28956 ) * Math.pow( Math.pow( this.floatState.BWL * this.coefficients.T, 0.5 ) / this.propeller.D, 0.2624 ) / + Math.pow( 1 - this.floatState.Cp + 0.0225 * this.coefficients.lcb, 0.01762 ) + 0.0015 * this.cstern; } else if ( this.propeller.noProps === 2 ) { - etar = 0.9737 + 0.111 * ( this.floatState.Cp - 0.0225 * lcb ) - 0.06325 * this.propeller.P / this.propeller.D; + t = 0.325 * this.floatState.Cb - 0.1885 * this.propeller.D / Math.pow( this.floatState.BWL * this.coefficients.T, 0.5 ); } - var T = KT * this.rho * Math.pow( n, 2 ) * Math.pow( this.propeller.D, 4 ); - var Q = KQ * this.rho * Math.pow( n, 2 ) * Math.pow( this.propeller.D, 5 ); - // console.log( `T: ${T}; Q: ${Q}`); - - var Fp = Math.sign( n ) * T * this.propeller.noProps * ( 1 - this.resistanceState.t ); - var Po = 2 * Math.PI * Math.abs( Q * n ) * this.propeller.noProps; - var Pp = Po * etar; - - var cons = this.getFuelCons( Pp ); - - return { Fp, Pp, cons }; + var etah = ( 1 - t ) / ( 1 - w ); // hull efficiency - } + return { w, t, etah }; - getFuelCons( Pp ) { + }, "efficiency" ) +} ); +// This module simulates the propeller and its interaction with hull and engine. - // share load among engines in a system's array - function shareLoad( system, load ) { +function PropellerInteraction( ship, states, propeller, rho = 1025 ) { - var triggerRatio = 0.8; // define loading rate at which next engine in the power system will be activated for sharing loads - var cons = 0; + StateModule.call( this, ship, states ); // get resistance results in N, W from vessel state + this.propeller = propeller; + if ( typeof this.states.discrete.FloatingCondition === "undefined" ) { - var engCapac = []; - for ( var i = 0; i < system.engines.length; i ++ ) { + this.setDraft(); - engCapac[ i ] = system.engines[ i ].MCR; + } - } + if ( typeof this.states.discrete.Speed === "undefined" ) { // if vessel does not have a speed state - if ( typeof system.etag === "number" ) { // diesel electrical system + this.setSpeed(); // use its design speed - load = load / ( system.etas * system.etag ); + } - } else { // diesel mechanical system + this.speedState = this.states.discrete.Speed.state; + this.floatState = this.states.discrete.FloatingCondition.state; + this.resistanceState = this.states.discrete.HullResistance.state; + this.rho = rho; // kg/m³ + this.output = [ "propulsion" ]; - load = load / system.etas; // consumption rate in kg/s + this.cacheDependence = [ "FloatingCondition", "Speed" ]; + this.cache = {}; - } +} - // distribute loads among engines - var totalCapac = engCapac.reduce( ( a, b ) => a + b, 0 ); - var partCapac = totalCapac - engCapac[ engCapac.length - 1 ]; - var loads = Array( engCapac.length ); - if ( load <= triggerRatio * partCapac ) { // if not all engines are loaded above trigger ratio, load them according to trigger rate ceil +PropellerInteraction.prototype = Object.create( StateModule.prototype ); - var capSum = 0; - loads.fill( 0 ); - for ( var eng = 0; eng < engCapac.length; eng ++ ) { +Object.assign( PropellerInteraction.prototype, { + constructor: PropellerInteraction, +} ); - capSum += engCapac[ eng ]; - if ( load <= triggerRatio * capSum ) { // if engines can support load +Object.defineProperties( PropellerInteraction.prototype, { + propulsion: StateModule.prototype.memoized( function () { - for ( i = 0; i <= eng; i ++ ) { // distribute load proportionally to engines' capacities + // convert vessel speed from knots to m/s + if ( this.speedSI === 0 ) { - loads[ i ] = load / capSum; + console.error( "Speed equals to zero, try getPropResult() method to get boolard pull or use changeSpeed() method to set a non null value." ); - } + } - break; + var speedSI = 0.514444 * this.speedState.speed; + var lcb = 100 * ( this.floatState.LCB - ( this.floatState.minXs + this.floatState.LWL / 2 ) ) / this.floatState.LWL; // % + var Va = speedSI / ( 1 - this.resistanceState.w ); // m/s + var T = this.resistanceState.Rtadd / ( this.propeller.noProps * ( 1 - this.resistanceState.t ) ); // N, thrust - } + var acoeff = T / ( this.rho * Math.pow( this.propeller.D * Va, 2 ) ); + var bcoeff = this.propeller.beta2; + var ccoeff = - this.propeller.beta1; + var J = ( - bcoeff + Math.pow( Math.pow( bcoeff, 2 ) - 4 * acoeff * ccoeff, 0.5 ) ) / ( 2 * acoeff ); - } + var n = Va / ( J * this.propeller.D ); // rps + // var npm = 60*n; - } else if ( triggerRatio * partCapac < load && load <= totalCapac ) { // if all engines are loaded above trigger ratio, make them all have same load % + var KT = this.propeller.beta1 - this.propeller.beta2 * J; + var KQ = this.propeller.gamma1 - this.propeller.gamma2 * J; + var eta0 = J * KT / ( 2 * Math.PI * KQ ); - loads.fill( load / totalCapac ); + var etar; + if ( this.propeller.noProps === 1 ) { - } else if ( load > totalCapac ) { + etar = 0.9922 - 0.05908 * this.propeller.AeAo + 0.07424 * ( this.floatState.Cp - 0.0225 * lcb ); - console.error( "Engines are overloaded. Power plant can't provide current required power." ); - loads.fill( 1 ); + } else if ( this.propeller.noProps === 2 ) { - } + etar = 0.9737 + 0.111 * ( this.floatState.Cp - 0.0225 * lcb ) - 0.06325 * this.propeller.P / this.propeller.D; - // calculate SFOC value for each activated engine - var SFOC; - for ( i = 0; i < loads.length; i ++ ) { + } - if ( loads[ i ] > 0 ) { // if engine is active + var eta = eta0 * this.resistanceState.etah * etar; + var Ps = this.resistanceState.Pe / eta; // W, required brake power - if ( system.engines[ i ].polOrder === 3 ) { + return { eta, Ps, n, Va }; - SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 3 ) + system.engines[ i ].b * Math.pow( loads[ i ], 2 ) + system.engines[ i ].c * loads[ i ] + system.engines[ i ].d; + }, "propulsion" ) +} ); +//@EliasHasle - } else if ( system.engines[ i ].polOrder === 2 ) { +//Depends on Ship and the other core classes. - SFOC = system.engines[ i ].a * Math.pow( loads[ i ], 2 ) + system.engines[ i ].b * loads[ i ] + system.engines[ i ].c; +/* +Handy function for letting the user load a ship design from a local file. (Based on Elias Hasles browseFile function.) - } +Typical usage: +Click here +where useShip takes the loaded ship design as a parameter adn does something with it. - cons += SFOC / ( 1000 ) * loads[ i ] * engCapac[ i ]; // consumption rate in kg/g +According to the ECMAScript standard, it is required that the file browsing is initiated by the user. Google Chrome seems to handle indirect initiation very well, such as having this function in a click handler. +*/ +"use strict"; +var browseShip = function() { + var browseButton; + return function(callback) { + browseButton = document.createElement("input"); + Object.assign(browseButton, { + type: "file", + multiple: false, + style: "display: none", + accept: ".json, application/json", + onchange: function(e) { + //console.log("Change event triggered on browse."); + let file = browseButton.files[0]; + let reader = new FileReader(); + reader.onload = function(event) { + let result = event.target.result; + let specification = JSON.parse(result); + let ship = new Ship(specification); + callback(ship); } - + reader.readAsText(file); } + }); + browseButton.click(); + }; +}();//@EliasHasle - return cons; - - } - - var consumptionRate; - - if ( typeof this.powerPlant.auxiliary === "object" ) { // calculate results for vessels which have main and auxiliary power systems - - // change the propeller states for the maneuvering proppeller - consumptionRate = this.powerPlant.main.noSys * shareLoad( powerPlant.main, Pp / ( 1000 * this.powerPlant.main.noSys ) ); - consumptionRate += shareLoad( this.powerPlant.auxiliary, this.auxPowerState.Paux / 1000 ); +//Depends on Ship and the other core classes. - } else { // calculate results for vessels which have only one power system +/* +Handy function for loading a ship design from file. - consumptionRate = shareLoad( this.powerPlant.main, Pp / 1000 ); +Typical usage: +var myShip; +var filePath = "ships/myShip.json"; +Vessel.loadShip(filePath, function(ship) { + myShip = ship; + doSomething(); +}); - } +*/ - return consumptionRate; +function loadShip( url, callback ) { - } + var request = new XMLHttpRequest(); + request.open( 'GET', url, true ); + request.addEventListener( "load", function ( event ) { + var response = event.target.response; + var specification = JSON.parse( response ); + var ship = new Ship( specification ); + callback( ship ); + } ); + request.send( null ); } +//@EliasHasle -const f = { - linearFromArrays, - bilinear, - bisectionSearch -}; - -if ( typeof window !== "undefined" ) { - - if ( window.__VESSEL__ ) { - - console.warn( "WARNING: Multiple instances of Vessel.js being imported." ); - - } else { - - window.__VESSEL__ = REVISION; - - } +//Very simple download of the specification of a given ship design. Depends on a working getSpecification method. +function downloadShip(ship) { + let specification = ship.getSpecification(); + let output = JSON.stringify(specification); + let link = document.createElement("a"); + link.href = "data:application/json," + encodeURI(output); + link.download = "shipdesignspecification.json"; + link.target = "_blank"; + link.click(); } - -export { BaseObject, DerivedObject, FuelConsumption, HullResistance, Manoeuver, Positioning, PropellerInteraction, Ship, ShipState, StateModule, WaveCreator, WaveMotion, downloadShip, f, loadShip }; +Object.assign(vessel, { + /*JSONSpecObject: JSONSpecObject,*/ + Ship: Ship, + Structure: Structure, + Hull: Hull, + BaseObject: BaseObject, + DerivedObject: DerivedObject, + ShipState: ShipState, + StateModule: StateModule, + WaveCreator: WaveCreator, + WaveMotion: WaveMotion, + Positioning: Positioning, + FuelConsumption: FuelConsumption, + HullResistance: HullResistance, + Manoeuvring: Manoeuvring, + PropellerInteraction: PropellerInteraction, + browseShip: browseShip, + loadShip: loadShip, + downloadShip: downloadShip, + f: { + linearFromArrays: linearFromArrays, + bilinear: bilinear, + bisectionSearch + }, + Vectors: Vectors +}); +})(); diff --git a/build/vessel.module.js b/build/vessel.module.js index 42fda36..3e9a2b7 100644 --- a/build/vessel.module.js +++ b/build/vessel.module.js @@ -3330,8 +3330,6 @@ class PropellerInteraction extends StateModule { function downloadShip( ship ) { - // TODO: Add the possibility to choose the json name and return the link metadata. - let specification = ship.getSpecification(); let output = JSON.stringify( specification ); let link = document.createElement( "a" ); diff --git a/build/vessel.zip b/build/vessel.zip deleted file mode 100644 index 222cb86..0000000 Binary files a/build/vessel.zip and /dev/null differ diff --git a/examples/libs/bootstrap.bundle.min.js b/examples/libs/bootstrap.bundle.min.js index 04e9185..7d50e87 100644 --- a/examples/libs/bootstrap.bundle.min.js +++ b/examples/libs/bootstrap.bundle.min.js @@ -1,7 +1,7 @@ /*! - * Bootstrap v5.3.3 (https://getbootstrap.com/) - * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + * Bootstrap v4.0.0 (https://getbootstrap.com) + * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t=new Map,e={set(e,i,n){t.has(e)||t.set(e,new Map);const s=t.get(e);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(e,i)=>t.has(e)&&t.get(e).get(i)||null,remove(e,i){if(!t.has(e))return;const n=t.get(e);n.delete(i),0===n.size&&t.delete(e)}},i="transitionend",n=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),s=t=>{t.dispatchEvent(new Event(i))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(n(t)):null,a=t=>{if(!o(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},l=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),c=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c(t.parentNode):null},h=()=>{},d=t=>{t.offsetHeight},u=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,f=[],p=()=>"rtl"===document.documentElement.dir,m=t=>{var e;e=()=>{const e=u();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of f)t()})),f.push(e)):e()},g=(t,e=[],i=t)=>"function"==typeof t?t(...e):i,_=(t,e,n=!0)=>{if(!n)return void g(t);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let r=!1;const a=({target:n})=>{n===e&&(r=!0,e.removeEventListener(i,a),g(t))};e.addEventListener(i,a),setTimeout((()=>{r||s(e)}),o)},b=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},v=/[^.]*(?=\..*)\.|.*/,y=/\..*/,w=/::\d+$/,A={};let E=1;const T={mouseenter:"mouseover",mouseleave:"mouseout"},C=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(t,e){return e&&`${e}::${E++}`||t.uidEvent||E++}function x(t){const e=O(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function k(t,e,i=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===i))}function L(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=I(t);return C.has(o)||(o=t),[n,s,o]}function S(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=L(e,i,n);if(e in T){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};r=t(r)}const l=x(t),c=l[a]||(l[a]={}),h=k(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=O(r,e.replace(v,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return P(s,{delegateTarget:r}),n.oneOff&&N.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return P(n,{delegateTarget:t}),i.oneOff&&N.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function D(t,e,i,n,s){const o=k(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function $(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&D(t,e,i,r.callable,r.delegationSelector)}function I(t){return t=t.replace(y,""),T[t]||t}const N={on(t,e,i,n){S(t,e,i,n,!1)},one(t,e,i,n){S(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=L(e,i,n),a=r!==e,l=x(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))$(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(w,"");a&&!e.includes(s)||D(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;D(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=u();let s=null,o=!0,r=!0,a=!1;e!==I(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=P(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function P(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function j(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function M(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const F={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${M(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${M(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1,i.length),e[i]=j(t.dataset[n])}return e},getDataAttribute:(t,e)=>j(t.getAttribute(`data-bs-${M(e)}`))};class H{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=o(e)?F.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...o(e)?F.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[n,s]of Object.entries(e)){const e=t[n],r=o(e)?"element":null==(i=e)?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${r}" but expected type "${s}".`)}var i}}class W extends H{constructor(t,i){super(),(t=r(t))&&(this._element=t,this._config=this._getConfig(i),e.set(this._element,this.constructor.DATA_KEY,this))}dispose(){e.remove(this._element,this.constructor.DATA_KEY),N.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){_(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return e.get(r(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const B=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map((t=>n(t))).join(","):null},z={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!l(t)&&a(t)))},getSelectorFromElement(t){const e=B(t);return e&&z.findOne(e)?e:null},getElementFromSelector(t){const e=B(t);return e?z.findOne(e):null},getMultipleElementsFromSelector(t){const e=B(t);return e?z.find(e):[]}},R=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;N.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),l(this))return;const s=z.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()}))},q=".bs.alert",V=`close${q}`,K=`closed${q}`;class Q extends W{static get NAME(){return"alert"}close(){if(N.trigger(this._element,V).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),N.trigger(this._element,K),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Q.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}R(Q,"close"),m(Q);const X='[data-bs-toggle="button"]';class Y extends W{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=Y.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}N.on(document,"click.bs.button.data-api",X,(t=>{t.preventDefault();const e=t.target.closest(X);Y.getOrCreateInstance(e).toggle()})),m(Y);const U=".bs.swipe",G=`touchstart${U}`,J=`touchmove${U}`,Z=`touchend${U}`,tt=`pointerdown${U}`,et=`pointerup${U}`,it={endCallback:null,leftCallback:null,rightCallback:null},nt={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class st extends H{constructor(t,e){super(),this._element=t,t&&st.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return it}static get DefaultType(){return nt}static get NAME(){return"swipe"}dispose(){N.off(this._element,U)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),g(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&g(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(N.on(this._element,tt,(t=>this._start(t))),N.on(this._element,et,(t=>this._end(t))),this._element.classList.add("pointer-event")):(N.on(this._element,G,(t=>this._start(t))),N.on(this._element,J,(t=>this._move(t))),N.on(this._element,Z,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ot=".bs.carousel",rt=".data-api",at="next",lt="prev",ct="left",ht="right",dt=`slide${ot}`,ut=`slid${ot}`,ft=`keydown${ot}`,pt=`mouseenter${ot}`,mt=`mouseleave${ot}`,gt=`dragstart${ot}`,_t=`load${ot}${rt}`,bt=`click${ot}${rt}`,vt="carousel",yt="active",wt=".active",At=".carousel-item",Et=wt+At,Tt={ArrowLeft:ht,ArrowRight:ct},Ct={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ot={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class xt extends W{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=z.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===vt&&this.cycle()}static get Default(){return Ct}static get DefaultType(){return Ot}static get NAME(){return"carousel"}next(){this._slide(at)}nextWhenVisible(){!document.hidden&&a(this._element)&&this.next()}prev(){this._slide(lt)}pause(){this._isSliding&&s(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?N.one(this._element,ut,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void N.one(this._element,ut,(()=>this.to(t)));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?at:lt;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&N.on(this._element,ft,(t=>this._keydown(t))),"hover"===this._config.pause&&(N.on(this._element,pt,(()=>this.pause())),N.on(this._element,mt,(()=>this._maybeEnableCycle()))),this._config.touch&&st.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of z.find(".carousel-item img",this._element))N.on(t,gt,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(ct)),rightCallback:()=>this._slide(this._directionToOrder(ht)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new st(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=Tt[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=z.findOne(wt,this._indicatorsElement);e.classList.remove(yt),e.removeAttribute("aria-current");const i=z.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(yt),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===at,s=e||b(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>N.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(dt).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),d(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(yt),i.classList.remove(yt,c,l),this._isSliding=!1,r(ut)}),i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return z.findOne(Et,this._element)}_getItems(){return z.find(At,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return p()?t===ct?lt:at:t===ct?at:lt}_orderToDirection(t){return p()?t===lt?ct:ht:t===lt?ht:ct}static jQueryInterface(t){return this.each((function(){const e=xt.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}N.on(document,bt,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=z.getElementFromSelector(this);if(!e||!e.classList.contains(vt))return;t.preventDefault();const i=xt.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===F.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),N.on(window,_t,(()=>{const t=z.find('[data-bs-ride="carousel"]');for(const e of t)xt.getOrCreateInstance(e)})),m(xt);const kt=".bs.collapse",Lt=`show${kt}`,St=`shown${kt}`,Dt=`hide${kt}`,$t=`hidden${kt}`,It=`click${kt}.data-api`,Nt="show",Pt="collapse",jt="collapsing",Mt=`:scope .${Pt} .${Pt}`,Ft='[data-bs-toggle="collapse"]',Ht={parent:null,toggle:!0},Wt={parent:"(null|element)",toggle:"boolean"};class Bt extends W{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=z.find(Ft);for(const t of i){const e=z.getSelectorFromElement(t),i=z.find(e).filter((t=>t===this._element));null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Ht}static get DefaultType(){return Wt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>Bt.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(N.trigger(this._element,Lt).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Pt),this._element.classList.add(jt),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(jt),this._element.classList.add(Pt,Nt),this._element.style[e]="",N.trigger(this._element,St)}),this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(N.trigger(this._element,Dt).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,d(this._element),this._element.classList.add(jt),this._element.classList.remove(Pt,Nt);for(const t of this._triggerArray){const e=z.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(jt),this._element.classList.add(Pt),N.trigger(this._element,$t)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(Nt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=r(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Ft);for(const e of t){const t=z.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=z.find(Mt,this._config.parent);return z.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const i=Bt.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}N.on(document,It,Ft,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of z.getMultipleElementsFromSelector(this))Bt.getOrCreateInstance(t,{toggle:!1}).toggle()})),m(Bt);var zt="top",Rt="bottom",qt="right",Vt="left",Kt="auto",Qt=[zt,Rt,qt,Vt],Xt="start",Yt="end",Ut="clippingParents",Gt="viewport",Jt="popper",Zt="reference",te=Qt.reduce((function(t,e){return t.concat([e+"-"+Xt,e+"-"+Yt])}),[]),ee=[].concat(Qt,[Kt]).reduce((function(t,e){return t.concat([e,e+"-"+Xt,e+"-"+Yt])}),[]),ie="beforeRead",ne="read",se="afterRead",oe="beforeMain",re="main",ae="afterMain",le="beforeWrite",ce="write",he="afterWrite",de=[ie,ne,se,oe,re,ae,le,ce,he];function ue(t){return t?(t.nodeName||"").toLowerCase():null}function fe(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function pe(t){return t instanceof fe(t).Element||t instanceof Element}function me(t){return t instanceof fe(t).HTMLElement||t instanceof HTMLElement}function ge(t){return"undefined"!=typeof ShadowRoot&&(t instanceof fe(t).ShadowRoot||t instanceof ShadowRoot)}const _e={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];me(s)&&ue(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});me(n)&&ue(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function be(t){return t.split("-")[0]}var ve=Math.max,ye=Math.min,we=Math.round;function Ae(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function Ee(){return!/^((?!chrome|android).)*safari/i.test(Ae())}function Te(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&me(t)&&(s=t.offsetWidth>0&&we(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&we(n.height)/t.offsetHeight||1);var r=(pe(t)?fe(t):window).visualViewport,a=!Ee()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ce(t){var e=Te(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Oe(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&ge(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function xe(t){return fe(t).getComputedStyle(t)}function ke(t){return["table","td","th"].indexOf(ue(t))>=0}function Le(t){return((pe(t)?t.ownerDocument:t.document)||window.document).documentElement}function Se(t){return"html"===ue(t)?t:t.assignedSlot||t.parentNode||(ge(t)?t.host:null)||Le(t)}function De(t){return me(t)&&"fixed"!==xe(t).position?t.offsetParent:null}function $e(t){for(var e=fe(t),i=De(t);i&&ke(i)&&"static"===xe(i).position;)i=De(i);return i&&("html"===ue(i)||"body"===ue(i)&&"static"===xe(i).position)?e:i||function(t){var e=/firefox/i.test(Ae());if(/Trident/i.test(Ae())&&me(t)&&"fixed"===xe(t).position)return null;var i=Se(t);for(ge(i)&&(i=i.host);me(i)&&["html","body"].indexOf(ue(i))<0;){var n=xe(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function Ie(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ne(t,e,i){return ve(t,ye(e,i))}function Pe(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function je(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const Me={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=be(i.placement),l=Ie(a),c=[Vt,qt].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return Pe("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:je(t,Qt))}(s.padding,i),d=Ce(o),u="y"===l?zt:Vt,f="y"===l?Rt:qt,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],m=r[l]-i.rects.reference[l],g=$e(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,v=h[u],y=_-d[c]-h[f],w=_/2-d[c]/2+b,A=Ne(v,w,y),E=l;i.modifiersData[n]=((e={})[E]=A,e.centerOffset=A-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Oe(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Fe(t){return t.split("-")[1]}var He={top:"auto",right:"auto",bottom:"auto",left:"auto"};function We(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=t.isFixed,u=r.x,f=void 0===u?0:u,p=r.y,m=void 0===p?0:p,g="function"==typeof h?h({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var _=r.hasOwnProperty("x"),b=r.hasOwnProperty("y"),v=Vt,y=zt,w=window;if(c){var A=$e(i),E="clientHeight",T="clientWidth";A===fe(i)&&"static"!==xe(A=Le(i)).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth"),(s===zt||(s===Vt||s===qt)&&o===Yt)&&(y=Rt,m-=(d&&A===w&&w.visualViewport?w.visualViewport.height:A[E])-n.height,m*=l?1:-1),s!==Vt&&(s!==zt&&s!==Rt||o!==Yt)||(v=qt,f-=(d&&A===w&&w.visualViewport?w.visualViewport.width:A[T])-n.width,f*=l?1:-1)}var C,O=Object.assign({position:a},c&&He),x=!0===h?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:we(i*s)/s||0,y:we(n*s)/s||0}}({x:f,y:m},fe(i)):{x:f,y:m};return f=x.x,m=x.y,l?Object.assign({},O,((C={})[y]=b?"0":"",C[v]=_?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",C)):Object.assign({},O,((e={})[y]=b?m+"px":"",e[v]=_?f+"px":"",e.transform="",e))}const Be={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:be(e.placement),variation:Fe(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,We(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,We(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ze={passive:!0};const Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=fe(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,ze)})),a&&l.addEventListener("resize",i.update,ze),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,ze)})),a&&l.removeEventListener("resize",i.update,ze)}},data:{}};var qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ve(t){return t.replace(/left|right|bottom|top/g,(function(t){return qe[t]}))}var Ke={start:"end",end:"start"};function Qe(t){return t.replace(/start|end/g,(function(t){return Ke[t]}))}function Xe(t){var e=fe(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ye(t){return Te(Le(t)).left+Xe(t).scrollLeft}function Ue(t){var e=xe(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Ge(t){return["html","body","#document"].indexOf(ue(t))>=0?t.ownerDocument.body:me(t)&&Ue(t)?t:Ge(Se(t))}function Je(t,e){var i;void 0===e&&(e=[]);var n=Ge(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=fe(n),r=s?[o].concat(o.visualViewport||[],Ue(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Je(Se(r)))}function Ze(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ti(t,e,i){return e===Gt?Ze(function(t,e){var i=fe(t),n=Le(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=Ee();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+Ye(t),y:l}}(t,i)):pe(e)?function(t,e){var i=Te(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):Ze(function(t){var e,i=Le(t),n=Xe(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=ve(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=ve(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+Ye(t),l=-n.scrollTop;return"rtl"===xe(s||i).direction&&(a+=ve(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(Le(t)))}function ei(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?be(s):null,r=s?Fe(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case zt:e={x:a,y:i.y-n.height};break;case Rt:e={x:a,y:i.y+i.height};break;case qt:e={x:i.x+i.width,y:l};break;case Vt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?Ie(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case Xt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Yt:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function ii(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.strategy,r=void 0===o?t.strategy:o,a=i.boundary,l=void 0===a?Ut:a,c=i.rootBoundary,h=void 0===c?Gt:c,d=i.elementContext,u=void 0===d?Jt:d,f=i.altBoundary,p=void 0!==f&&f,m=i.padding,g=void 0===m?0:m,_=Pe("number"!=typeof g?g:je(g,Qt)),b=u===Jt?Zt:Jt,v=t.rects.popper,y=t.elements[p?b:u],w=function(t,e,i,n){var s="clippingParents"===e?function(t){var e=Je(Se(t)),i=["absolute","fixed"].indexOf(xe(t).position)>=0&&me(t)?$e(t):t;return pe(i)?e.filter((function(t){return pe(t)&&Oe(t,i)&&"body"!==ue(t)})):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce((function(e,i){var s=ti(t,i,n);return e.top=ve(s.top,e.top),e.right=ye(s.right,e.right),e.bottom=ye(s.bottom,e.bottom),e.left=ve(s.left,e.left),e}),ti(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(pe(y)?y:y.contextElement||Le(t.elements.popper),l,h,r),A=Te(t.elements.reference),E=ei({reference:A,element:v,strategy:"absolute",placement:s}),T=Ze(Object.assign({},v,E)),C=u===Jt?T:A,O={top:w.top-C.top+_.top,bottom:C.bottom-w.bottom+_.bottom,left:w.left-C.left+_.left,right:C.right-w.right+_.right},x=t.modifiersData.offset;if(u===Jt&&x){var k=x[s];Object.keys(O).forEach((function(t){var e=[qt,Rt].indexOf(t)>=0?1:-1,i=[zt,Rt].indexOf(t)>=0?"y":"x";O[t]+=k[i]*e}))}return O}function ni(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ee:l,h=Fe(n),d=h?a?te:te.filter((function(t){return Fe(t)===h})):Qt,u=d.filter((function(t){return c.indexOf(t)>=0}));0===u.length&&(u=d);var f=u.reduce((function(e,i){return e[i]=ii(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[be(i)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}const si={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,m=i.allowedAutoPlacements,g=e.options.placement,_=be(g),b=l||(_!==g&&p?function(t){if(be(t)===Kt)return[];var e=Ve(t);return[Qe(t),e,Qe(e)]}(g):[Ve(g)]),v=[g].concat(b).reduce((function(t,i){return t.concat(be(i)===Kt?ni(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):i)}),[]),y=e.rects.reference,w=e.rects.popper,A=new Map,E=!0,T=v[0],C=0;C=0,S=L?"width":"height",D=ii(e,{placement:O,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),$=L?k?qt:Vt:k?Rt:zt;y[S]>w[S]&&($=Ve($));var I=Ve($),N=[];if(o&&N.push(D[x]<=0),a&&N.push(D[$]<=0,D[I]<=0),N.every((function(t){return t}))){T=O,E=!1;break}A.set(O,N)}if(E)for(var P=function(t){var e=v.find((function(e){var i=A.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},j=p?3:1;j>0&&"break"!==P(j);j--);e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function oi(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function ri(t){return[zt,qt,Rt,Vt].some((function(e){return t[e]>=0}))}const ai={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=ii(e,{elementContext:"reference"}),a=ii(e,{altBoundary:!0}),l=oi(r,n),c=oi(a,s,o),h=ri(l),d=ri(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},li={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=ee.reduce((function(t,i){return t[i]=function(t,e,i){var n=be(t),s=[Vt,zt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[Vt,qt].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}},ci={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=ei({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},hi={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,m=void 0===p?0:p,g=ii(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),_=be(e.placement),b=Fe(e.placement),v=!b,y=Ie(_),w="x"===y?"y":"x",A=e.modifiersData.popperOffsets,E=e.rects.reference,T=e.rects.popper,C="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,O="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),x=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,k={x:0,y:0};if(A){if(o){var L,S="y"===y?zt:Vt,D="y"===y?Rt:qt,$="y"===y?"height":"width",I=A[y],N=I+g[S],P=I-g[D],j=f?-T[$]/2:0,M=b===Xt?E[$]:T[$],F=b===Xt?-T[$]:-E[$],H=e.elements.arrow,W=f&&H?Ce(H):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[S],R=B[D],q=Ne(0,E[$],W[$]),V=v?E[$]/2-j-q-z-O.mainAxis:M-q-z-O.mainAxis,K=v?-E[$]/2+j+q+R+O.mainAxis:F+q+R+O.mainAxis,Q=e.elements.arrow&&$e(e.elements.arrow),X=Q?"y"===y?Q.clientTop||0:Q.clientLeft||0:0,Y=null!=(L=null==x?void 0:x[y])?L:0,U=I+K-Y,G=Ne(f?ye(N,I+V-Y-X):N,I,f?ve(P,U):P);A[y]=G,k[y]=G-I}if(a){var J,Z="x"===y?zt:Vt,tt="x"===y?Rt:qt,et=A[w],it="y"===w?"height":"width",nt=et+g[Z],st=et-g[tt],ot=-1!==[zt,Vt].indexOf(_),rt=null!=(J=null==x?void 0:x[w])?J:0,at=ot?nt:et-E[it]-T[it]-rt+O.altAxis,lt=ot?et+E[it]+T[it]-rt-O.altAxis:st,ct=f&&ot?function(t,e,i){var n=Ne(t,e,i);return n>i?i:n}(at,et,lt):Ne(f?at:nt,et,f?lt:st);A[w]=ct,k[w]=ct-et}e.modifiersData[n]=k}},requiresIfExists:["offset"]};function di(t,e,i){void 0===i&&(i=!1);var n,s,o=me(e),r=me(e)&&function(t){var e=t.getBoundingClientRect(),i=we(e.width)/t.offsetWidth||1,n=we(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=Le(e),l=Te(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==ue(e)||Ue(a))&&(c=(n=e)!==fe(n)&&me(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Xe(n)),me(e)?((h=Te(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=Ye(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function ui(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var fi={placement:"bottom",modifiers:[],strategy:"absolute"};function pi(){for(var t=arguments.length,e=new Array(t),i=0;iNumber.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(F.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...g(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const i=z.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>a(t)));i.length&&b(i,e,t===Ti,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=qi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=z.find(Ni);for(const i of e){const e=qi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Ei,Ti].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Ii)?this:z.prev(this,Ii)[0]||z.next(this,Ii)[0]||z.findOne(Ii,t.delegateTarget.parentNode),o=qi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}N.on(document,Si,Ii,qi.dataApiKeydownHandler),N.on(document,Si,Pi,qi.dataApiKeydownHandler),N.on(document,Li,qi.clearMenus),N.on(document,Di,qi.clearMenus),N.on(document,Li,Ii,(function(t){t.preventDefault(),qi.getOrCreateInstance(this).toggle()})),m(qi);const Vi="backdrop",Ki="show",Qi=`mousedown.bs.${Vi}`,Xi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Yi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Ui extends H{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Xi}static get DefaultType(){return Yi}static get NAME(){return Vi}show(t){if(!this._config.isVisible)return void g(t);this._append();const e=this._getElement();this._config.isAnimated&&d(e),e.classList.add(Ki),this._emulateAnimation((()=>{g(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Ki),this._emulateAnimation((()=>{this.dispose(),g(t)}))):g(t)}dispose(){this._isAppended&&(N.off(this._element,Qi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=r(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),N.on(t,Qi,(()=>{g(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){_(t,this._getElement(),this._config.isAnimated)}}const Gi=".bs.focustrap",Ji=`focusin${Gi}`,Zi=`keydown.tab${Gi}`,tn="backward",en={autofocus:!0,trapElement:null},nn={autofocus:"boolean",trapElement:"element"};class sn extends H{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return en}static get DefaultType(){return nn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),N.off(document,Gi),N.on(document,Ji,(t=>this._handleFocusin(t))),N.on(document,Zi,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,N.off(document,Gi))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=z.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===tn?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?tn:"forward")}}const on=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",rn=".sticky-top",an="padding-right",ln="margin-right";class cn{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,an,(e=>e+t)),this._setElementAttributes(on,an,(e=>e+t)),this._setElementAttributes(rn,ln,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,an),this._resetElementAttributes(on,an),this._resetElementAttributes(rn,ln)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&F.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=F.getDataAttribute(t,e);null!==i?(F.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(o(t))e(t);else for(const i of z.find(t,this._element))e(i)}}const hn=".bs.modal",dn=`hide${hn}`,un=`hidePrevented${hn}`,fn=`hidden${hn}`,pn=`show${hn}`,mn=`shown${hn}`,gn=`resize${hn}`,_n=`click.dismiss${hn}`,bn=`mousedown.dismiss${hn}`,vn=`keydown.dismiss${hn}`,yn=`click${hn}.data-api`,wn="modal-open",An="show",En="modal-static",Tn={backdrop:!0,focus:!0,keyboard:!0},Cn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class On extends W{constructor(t,e){super(t,e),this._dialog=z.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new cn,this._addEventListeners()}static get Default(){return Tn}static get DefaultType(){return Cn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||N.trigger(this._element,pn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(wn),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){this._isShown&&!this._isTransitioning&&(N.trigger(this._element,dn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(An),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){N.off(window,hn),N.off(this._dialog,hn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Ui({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=z.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),d(this._element),this._element.classList.add(An),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,N.trigger(this._element,mn,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){N.on(this._element,vn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),N.on(window,gn,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),N.on(this._element,bn,(t=>{N.one(this._element,_n,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(wn),this._resetAdjustments(),this._scrollBar.reset(),N.trigger(this._element,fn)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(N.trigger(this._element,un).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(En)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(En),this._queueCallback((()=>{this._element.classList.remove(En),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=p()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=p()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=On.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}N.on(document,yn,'[data-bs-toggle="modal"]',(function(t){const e=z.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),N.one(e,pn,(t=>{t.defaultPrevented||N.one(e,fn,(()=>{a(this)&&this.focus()}))}));const i=z.findOne(".modal.show");i&&On.getInstance(i).hide(),On.getOrCreateInstance(e).toggle(this)})),R(On),m(On);const xn=".bs.offcanvas",kn=".data-api",Ln=`load${xn}${kn}`,Sn="show",Dn="showing",$n="hiding",In=".offcanvas.show",Nn=`show${xn}`,Pn=`shown${xn}`,jn=`hide${xn}`,Mn=`hidePrevented${xn}`,Fn=`hidden${xn}`,Hn=`resize${xn}`,Wn=`click${xn}${kn}`,Bn=`keydown.dismiss${xn}`,zn={backdrop:!0,keyboard:!0,scroll:!1},Rn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class qn extends W{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return zn}static get DefaultType(){return Rn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||N.trigger(this._element,Nn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new cn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Dn),this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Sn),this._element.classList.remove(Dn),N.trigger(this._element,Pn,{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(N.trigger(this._element,jn).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add($n),this._backdrop.hide(),this._queueCallback((()=>{this._element.classList.remove(Sn,$n),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new cn).reset(),N.trigger(this._element,Fn)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Ui({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():N.trigger(this._element,Mn)}:null})}_initializeFocusTrap(){return new sn({trapElement:this._element})}_addEventListeners(){N.on(this._element,Bn,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():N.trigger(this._element,Mn))}))}static jQueryInterface(t){return this.each((function(){const e=qn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}N.on(document,Wn,'[data-bs-toggle="offcanvas"]',(function(t){const e=z.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),l(this))return;N.one(e,Fn,(()=>{a(this)&&this.focus()}));const i=z.findOne(In);i&&i!==e&&qn.getInstance(i).hide(),qn.getOrCreateInstance(e).toggle(this)})),N.on(window,Ln,(()=>{for(const t of z.find(In))qn.getOrCreateInstance(t).show()})),N.on(window,Hn,(()=>{for(const t of z.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&qn.getOrCreateInstance(t).hide()})),R(qn),m(qn);const Vn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Kn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Qn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Xn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Kn.has(i)||Boolean(Qn.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(i)))},Yn={allowList:Vn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:""},Un={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Gn={entry:"(string|element|function|null)",selector:"(string|element)"};class Jn extends H{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Yn}static get DefaultType(){return Un}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Gn)}_setContent(t,e,i){const n=z.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?o(e)?this._putElementInTemplate(r(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Xn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return g(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Zn=new Set(["sanitize","allowList","sanitizeFn"]),ts="fade",es="show",is=".modal",ns="hide.bs.modal",ss="hover",os="focus",rs={AUTO:"auto",TOP:"top",RIGHT:p()?"left":"right",BOTTOM:"bottom",LEFT:p()?"right":"left"},as={allowList:Vn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},ls={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class cs extends W{constructor(t,e){if(void 0===vi)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return as}static get DefaultType(){return ls}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),N.off(this._element.closest(is),ns,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=N.trigger(this._element,this.constructor.eventName("show")),e=(c(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),N.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))N.on(t,"mouseover",h);this._queueCallback((()=>{N.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(this._isShown()&&!N.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(es),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))N.off(t,"mouseover",h);this._activeTrigger.click=!1,this._activeTrigger[os]=!1,this._activeTrigger[ss]=!1,this._isHovered=null,this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),N.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ts,es),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ts),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Jn({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ts)}_isShown(){return this.tip&&this.tip.classList.contains(es)}_createPopper(t){const e=g(this._config.placement,[this,t,this._element]),i=rs[e.toUpperCase()];return bi(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return g(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...g(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)N.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ss?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===ss?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");N.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?os:ss]=!0,e._enter()})),N.on(this._element,i,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?os:ss]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},N.on(this._element.closest(is),ns,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=F.getDataAttributes(this._element);for(const t of Object.keys(e))Zn.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:r(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=cs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m(cs);const hs={...cs.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},ds={...cs.DefaultType,content:"(null|string|element|function)"};class us extends cs{static get Default(){return hs}static get DefaultType(){return ds}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=us.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}m(us);const fs=".bs.scrollspy",ps=`activate${fs}`,ms=`click${fs}`,gs=`load${fs}.data-api`,_s="active",bs="[href]",vs=".nav-link",ys=`${vs}, .nav-item > ${vs}, .list-group-item`,ws={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},As={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Es extends W{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ws}static get DefaultType(){return As}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=r(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(N.off(this._config.target,ms),N.on(this._config.target,ms,bs,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=z.find(bs,this._config.target);for(const e of t){if(!e.hash||l(e))continue;const t=z.findOne(decodeURI(e.hash),this._element);a(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(_s),this._activateParents(t),N.trigger(this._element,ps,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))z.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(_s);else for(const e of z.parents(t,".nav, .list-group"))for(const t of z.prev(e,ys))t.classList.add(_s)}_clearActiveClass(t){t.classList.remove(_s);const e=z.find(`${bs}.${_s}`,t);for(const t of e)t.classList.remove(_s)}static jQueryInterface(t){return this.each((function(){const e=Es.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(window,gs,(()=>{for(const t of z.find('[data-bs-spy="scroll"]'))Es.getOrCreateInstance(t)})),m(Es);const Ts=".bs.tab",Cs=`hide${Ts}`,Os=`hidden${Ts}`,xs=`show${Ts}`,ks=`shown${Ts}`,Ls=`click${Ts}`,Ss=`keydown${Ts}`,Ds=`load${Ts}`,$s="ArrowLeft",Is="ArrowRight",Ns="ArrowUp",Ps="ArrowDown",js="Home",Ms="End",Fs="active",Hs="fade",Ws="show",Bs=".dropdown-toggle",zs=`:not(${Bs})`,Rs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',qs=`.nav-link${zs}, .list-group-item${zs}, [role="tab"]${zs}, ${Rs}`,Vs=`.${Fs}[data-bs-toggle="tab"], .${Fs}[data-bs-toggle="pill"], .${Fs}[data-bs-toggle="list"]`;class Ks extends W{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),N.on(this._element,Ss,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?N.trigger(e,Cs,{relatedTarget:t}):null;N.trigger(t,xs,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(Fs),this._activate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),N.trigger(t,ks,{relatedTarget:e})):t.classList.add(Ws)}),t,t.classList.contains(Hs)))}_deactivate(t,e){t&&(t.classList.remove(Fs),t.blur(),this._deactivate(z.getElementFromSelector(t)),this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),N.trigger(t,Os,{relatedTarget:e})):t.classList.remove(Ws)}),t,t.classList.contains(Hs)))}_keydown(t){if(![$s,Is,Ns,Ps,js,Ms].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!l(t)));let i;if([js,Ms].includes(t.key))i=e[t.key===js?0:e.length-1];else{const n=[Is,Ps].includes(t.key);i=b(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Ks.getOrCreateInstance(i).show())}_getChildren(){return z.find(qs,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=z.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=z.findOne(t,i);s&&s.classList.toggle(n,e)};n(Bs,Fs),n(".dropdown-menu",Ws),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Fs)}_getInnerElement(t){return t.matches(qs)?t:z.findOne(qs,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=Ks.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}N.on(document,Ls,Rs,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),l(this)||Ks.getOrCreateInstance(this).show()})),N.on(window,Ds,(()=>{for(const t of z.find(Vs))Ks.getOrCreateInstance(t)})),m(Ks);const Qs=".bs.toast",Xs=`mouseover${Qs}`,Ys=`mouseout${Qs}`,Us=`focusin${Qs}`,Gs=`focusout${Qs}`,Js=`hide${Qs}`,Zs=`hidden${Qs}`,to=`show${Qs}`,eo=`shown${Qs}`,io="hide",no="show",so="showing",oo={animation:"boolean",autohide:"boolean",delay:"number"},ro={animation:!0,autohide:!0,delay:5e3};class ao extends W{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return ro}static get DefaultType(){return oo}static get NAME(){return"toast"}show(){N.trigger(this._element,to).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(io),d(this._element),this._element.classList.add(no,so),this._queueCallback((()=>{this._element.classList.remove(so),N.trigger(this._element,eo),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this.isShown()&&(N.trigger(this._element,Js).defaultPrevented||(this._element.classList.add(so),this._queueCallback((()=>{this._element.classList.add(io),this._element.classList.remove(so,no),N.trigger(this._element,Zs)}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(no),super.dispose()}isShown(){return this._element.classList.contains(no)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){N.on(this._element,Xs,(t=>this._onInteraction(t,!0))),N.on(this._element,Ys,(t=>this._onInteraction(t,!1))),N.on(this._element,Us,(t=>this._onInteraction(t,!0))),N.on(this._element,Gs,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=ao.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return R(ao),m(ao),{Alert:Q,Button:Y,Carousel:xt,Collapse:Bt,Dropdown:qi,Modal:On,Offcanvas:qn,Popover:us,ScrollSpy:Es,Tab:Ks,Toast:ao,Tooltip:cs}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],e):e(t.bootstrap={},t.jQuery)}(this,function(t,e){"use strict";function n(t,e){for(var n=0;n0?i:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(n){t(n).trigger(e.end)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r],s=e[r],a=s&&i.isElement(s)?"element":(l=s,{}.toString.call(l).match(/\s([a-zA-Z]+)/)[1].toLowerCase());if(!new RegExp(o).test(a))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+a+'" but expected type "'+o+'".')}var l}};return e=("undefined"==typeof window||!window.QUnit)&&{end:"transitionend"},t.fn.emulateTransitionEnd=n,i.supportsTransitionEnd()&&(t.event.special[i.TRANSITION_END]={bindType:e.end,delegateType:e.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}),i}(e=e&&e.hasOwnProperty("default")?e.default:e),L=(s="alert",l="."+(a="bs.alert"),c=(o=e).fn[s],h={CLOSE:"close"+l,CLOSED:"closed"+l,CLICK_DATA_API:"click"+l+".data-api"},f="alert",u="fade",d="show",p=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.removeData(this._element,a),this._element=null},e._getRootElement=function(t){var e=k.getSelectorFromElement(t),n=!1;return e&&(n=o(e)[0]),n||(n=o(t).closest("."+f)[0]),n},e._triggerCloseEvent=function(t){var e=o.Event(h.CLOSE);return o(t).trigger(e),e},e._removeElement=function(t){var e=this;o(t).removeClass(d),k.supportsTransitionEnd()&&o(t).hasClass(u)?o(t).one(k.TRANSITION_END,function(n){return e._destroyElement(t,n)}).emulateTransitionEnd(150):this._destroyElement(t)},e._destroyElement=function(t){o(t).detach().trigger(h.CLOSED).remove()},t._jQueryInterface=function(e){return this.each(function(){var n=o(this),i=n.data(a);i||(i=new t(this),n.data(a,i)),"close"===e&&i[e](this)})},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},i(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),o(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),o.fn[s]=p._jQueryInterface,o.fn[s].Constructor=p,o.fn[s].noConflict=function(){return o.fn[s]=c,p._jQueryInterface},p),P=(m="button",v="."+(_="bs.button"),E=".data-api",y=(g=e).fn[m],b="active",T="btn",C="focus",w='[data-toggle^="button"]',I='[data-toggle="buttons"]',A="input",D=".active",S=".btn",O={CLICK_DATA_API:"click"+v+E,FOCUS_BLUR_DATA_API:"focus"+v+E+" blur"+v+E},N=function(){function t(t){this._element=t}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(I)[0];if(n){var i=g(this._element).find(A)[0];if(i){if("radio"===i.type)if(i.checked&&g(this._element).hasClass(b))t=!1;else{var r=g(n).find(D)[0];r&&g(r).removeClass(b)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!g(this._element).hasClass(b),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!g(this._element).hasClass(b)),t&&g(this._element).toggleClass(b)},e.dispose=function(){g.removeData(this._element,_),this._element=null},t._jQueryInterface=function(e){return this.each(function(){var n=g(this).data(_);n||(n=new t(this),g(this).data(_,n)),"toggle"===e&&n[e]()})},i(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),g(document).on(O.CLICK_DATA_API,w,function(t){t.preventDefault();var e=t.target;g(e).hasClass(T)||(e=g(e).closest(S)),N._jQueryInterface.call(g(e),"toggle")}).on(O.FOCUS_BLUR_DATA_API,w,function(t){var e=g(t.target).closest(S)[0];g(e).toggleClass(C,/^focus(in)?$/.test(t.type))}),g.fn[m]=N._jQueryInterface,g.fn[m].Constructor=N,g.fn[m].noConflict=function(){return g.fn[m]=y,N._jQueryInterface},N),x=function(t){var e="carousel",n="bs.carousel",o="."+n,s=t.fn[e],a={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},l={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},c="next",h="prev",f="left",u="right",d={SLIDE:"slide"+o,SLID:"slid"+o,KEYDOWN:"keydown"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o,TOUCHEND:"touchend"+o,LOAD_DATA_API:"load"+o+".data-api",CLICK_DATA_API:"click"+o+".data-api"},p="carousel",g="active",m="slide",_="carousel-item-right",v="carousel-item-left",E="carousel-item-next",y="carousel-item-prev",b={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},T=function(){function s(e,n){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(n),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(b.INDICATORS)[0],this._addEventListeners()}var T=s.prototype;return T.next=function(){this._isSliding||this._slide(c)},T.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},T.prev=function(){this._isSliding||this._slide(h)},T.pause=function(e){e||(this._isPaused=!0),t(this._element).find(b.NEXT_PREV)[0]&&k.supportsTransitionEnd()&&(k.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},T.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},T.to=function(e){var n=this;this._activeElement=t(this._element).find(b.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var r=e>i?c:h;this._slide(r,this._items[e])}},T.dispose=function(){t(this._element).off(o),t.removeData(this._element,n),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},T._getConfig=function(t){return t=r({},a,t),k.typeCheckConfig(e,t,l),t},T._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},T._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},T._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(b.ITEM)),this._items.indexOf(e)},T._getItemByDirection=function(t,e){var n=t===c,i=t===h,r=this._getItemIndex(e),o=this._items.length-1;if((i&&0===r||n&&r===o)&&!this._config.wrap)return e;var s=(r+(t===h?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},T._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),r=this._getItemIndex(t(this._element).find(b.ACTIVE_ITEM)[0]),o=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:r,to:i});return t(this._element).trigger(o),o},T._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(b.ACTIVE).removeClass(g);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(g)}},T._slide=function(e,n){var i,r,o,s=this,a=t(this._element).find(b.ACTIVE_ITEM)[0],l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(e,a),p=this._getItemIndex(h),T=Boolean(this._interval);if(e===c?(i=v,r=E,o=f):(i=_,r=y,o=u),h&&t(h).hasClass(g))this._isSliding=!1;else if(!this._triggerSlideEvent(h,o).isDefaultPrevented()&&a&&h){this._isSliding=!0,T&&this.pause(),this._setActiveIndicatorElement(h);var C=t.Event(d.SLID,{relatedTarget:h,direction:o,from:l,to:p});k.supportsTransitionEnd()&&t(this._element).hasClass(m)?(t(h).addClass(r),k.reflow(h),t(a).addClass(i),t(h).addClass(i),t(a).one(k.TRANSITION_END,function(){t(h).removeClass(i+" "+r).addClass(g),t(a).removeClass(g+" "+r+" "+i),s._isSliding=!1,setTimeout(function(){return t(s._element).trigger(C)},0)}).emulateTransitionEnd(600)):(t(a).removeClass(g),t(h).addClass(g),this._isSliding=!1,t(this._element).trigger(C)),T&&this.cycle()}},s._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),o=r({},a,t(this).data());"object"==typeof e&&(o=r({},o,e));var l="string"==typeof e?e:o.slide;if(i||(i=new s(this,o),t(this).data(n,i)),"number"==typeof e)i.to(e);else if("string"==typeof l){if("undefined"==typeof i[l])throw new TypeError('No method named "'+l+'"');i[l]()}else o.interval&&(i.pause(),i.cycle())})},s._dataApiClickHandler=function(e){var i=k.getSelectorFromElement(this);if(i){var o=t(i)[0];if(o&&t(o).hasClass(p)){var a=r({},t(o).data(),t(this).data()),l=this.getAttribute("data-slide-to");l&&(a.interval=!1),s._jQueryInterface.call(t(o),a),l&&t(o).data(n).to(l),e.preventDefault()}}},i(s,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),s}();return t(document).on(d.CLICK_DATA_API,b.DATA_SLIDE,T._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(b.DATA_RIDE).each(function(){var e=t(this);T._jQueryInterface.call(e,e.data())})}),t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=s,T._jQueryInterface},T}(e),R=function(t){var e="collapse",n="bs.collapse",o="."+n,s=t.fn[e],a={toggle:!0,parent:""},l={toggle:"boolean",parent:"(string|element)"},c={SHOW:"show"+o,SHOWN:"shown"+o,HIDE:"hide"+o,HIDDEN:"hidden"+o,CLICK_DATA_API:"click"+o+".data-api"},h="show",f="collapse",u="collapsing",d="collapsed",p="width",g="height",m={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},_=function(){function o(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=t(m.DATA_TOGGLE),r=0;r0&&(this._selector=s,this._triggerArray.push(o))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var s=o.prototype;return s.toggle=function(){t(this._element).hasClass(h)?this.hide():this.show()},s.show=function(){var e,i,r=this;if(!this._isTransitioning&&!t(this._element).hasClass(h)&&(this._parent&&0===(e=t.makeArray(t(this._parent).find(m.ACTIVES).filter('[data-parent="'+this._config.parent+'"]'))).length&&(e=null),!(e&&(i=t(e).not(this._selector).data(n))&&i._isTransitioning))){var s=t.Event(c.SHOW);if(t(this._element).trigger(s),!s.isDefaultPrevented()){e&&(o._jQueryInterface.call(t(e).not(this._selector),"hide"),i||t(e).data(n,null));var a=this._getDimension();t(this._element).removeClass(f).addClass(u),this._element.style[a]=0,this._triggerArray.length>0&&t(this._triggerArray).removeClass(d).attr("aria-expanded",!0),this.setTransitioning(!0);var l=function(){t(r._element).removeClass(u).addClass(f).addClass(h),r._element.style[a]="",r.setTransitioning(!1),t(r._element).trigger(c.SHOWN)};if(k.supportsTransitionEnd()){var p="scroll"+(a[0].toUpperCase()+a.slice(1));t(this._element).one(k.TRANSITION_END,l).emulateTransitionEnd(600),this._element.style[a]=this._element[p]+"px"}else l()}}},s.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(h)){var n=t.Event(c.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",k.reflow(this._element),t(this._element).addClass(u).removeClass(f).removeClass(h),this._triggerArray.length>0)for(var r=0;r0&&t(n).toggleClass(d,!i).attr("aria-expanded",i)}},o._getTargetFromElement=function(e){var n=k.getSelectorFromElement(e);return n?t(n)[0]:null},o._jQueryInterface=function(e){return this.each(function(){var i=t(this),s=i.data(n),l=r({},a,i.data(),"object"==typeof e&&e);if(!s&&l.toggle&&/show|hide/.test(e)&&(l.toggle=!1),s||(s=new o(this,l),i.data(n,s)),"string"==typeof e){if("undefined"==typeof s[e])throw new TypeError('No method named "'+e+'"');s[e]()}})},i(o,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),o}();return t(document).on(c.CLICK_DATA_API,m.DATA_TOGGLE,function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var i=t(this),r=k.getSelectorFromElement(this);t(r).each(function(){var e=t(this),r=e.data(n)?"toggle":i.data();_._jQueryInterface.call(e,r)})}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=s,_._jQueryInterface},_}(e),j="undefined"!=typeof window&&"undefined"!=typeof document,H=["Edge","Trident","Firefox"],M=0,W=0;W=0){M=1;break}var U=j&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},M))}};function B(t){return t&&"[object Function]"==={}.toString.call(t)}function F(t,e){if(1!==t.nodeType)return[];var n=getComputedStyle(t,null);return e?n[e]:n}function K(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function V(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=F(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/(auto|scroll)/.test(n+r+i)?t:V(K(t))}function Q(t){var e=t&&t.offsetParent,n=e&&e.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(e.nodeName)&&"static"===F(e,"position")?Q(e):e:t?t.ownerDocument.documentElement:document.documentElement}function Y(t){return null!==t.parentNode?Y(t.parentNode):t}function G(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,r=n?e:t,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s,a,l=o.commonAncestorContainer;if(t!==l&&e!==l||i.contains(r))return"BODY"===(a=(s=l).nodeName)||"HTML"!==a&&Q(s.firstElementChild)!==s?Q(l):l;var c=Y(t);return c.host?G(c.host,e):G(t,Y(e).host)}function q(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var i=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||i)[e]}return t[e]}function z(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+i+"Width"],10)}var X=void 0,Z=function(){return void 0===X&&(X=-1!==navigator.appVersion.indexOf("MSIE 10")),X};function J(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Z()?n["offset"+t]+i["margin"+("Height"===t?"Top":"Left")]+i["margin"+("Height"===t?"Bottom":"Right")]:0)}function $(){var t=document.body,e=document.documentElement,n=Z()&&getComputedStyle(e);return{height:J("Height",t,e,n),width:J("Width",t,e,n)}}var tt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},et=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],i=q(e,"top"),r=q(e,"left"),o=n?-1:1;return t.top+=i*o,t.bottom+=i*o,t.left+=r*o,t.right+=r*o,t}(h,e)),h}function at(t,e,n,i){var r,o,s,a,l,c,h,f={top:0,left:0},u=G(t,e);if("viewport"===i)o=(r=u).ownerDocument.documentElement,s=st(r,o),a=Math.max(o.clientWidth,window.innerWidth||0),l=Math.max(o.clientHeight,window.innerHeight||0),c=q(o),h=q(o,"left"),f=rt({top:c-s.top+s.marginTop,left:h-s.left+s.marginLeft,width:a,height:l});else{var d=void 0;"scrollParent"===i?"BODY"===(d=V(K(e))).nodeName&&(d=t.ownerDocument.documentElement):d="window"===i?t.ownerDocument.documentElement:i;var p=st(d,u);if("HTML"!==d.nodeName||function t(e){var n=e.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===F(e,"position")||t(K(e)))}(u))f=p;else{var g=$(),m=g.height,_=g.width;f.top+=p.top-p.marginTop,f.bottom=m+p.top,f.left+=p.left-p.marginLeft,f.right=_+p.left}}return f.left+=n,f.top+=n,f.right-=n,f.bottom-=n,f}function lt(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=at(n,i,o,r),a={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},l=Object.keys(a).map(function(t){return it({key:t},a[t],{area:(e=a[t],e.width*e.height)});var e}).sort(function(t,e){return e.area-t.area}),c=l.filter(function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight}),h=c.length>0?c[0].key:l[0].key,f=t.split("-")[1];return h+(f?"-"+f:"")}function ct(t,e,n){return st(n,G(e,n))}function ht(t){var e=getComputedStyle(t),n=parseFloat(e.marginTop)+parseFloat(e.marginBottom),i=parseFloat(e.marginLeft)+parseFloat(e.marginRight);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function ft(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function ut(t,e,n){n=n.split("-")[0];var i=ht(t),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return r[s]=e[s]+e[l]/2-i[l]/2,r[a]=n===a?e[a]-i[c]:e[ft(a)],r}function dt(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function pt(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var i=dt(t,function(t){return t[e]===n});return t.indexOf(i)}(t,"name",n))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&B(n)&&(e.offsets.popper=rt(e.offsets.popper),e.offsets.reference=rt(e.offsets.reference),e=n(e,t))}),e}function gt(t,e){return t.some(function(t){var n=t.name;return t.enabled&&n===e})}function mt(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i1&&void 0!==arguments[1]&&arguments[1],n=wt.indexOf(t),i=wt.slice(n+1).concat(wt.slice(0,n));return e?i.reverse():i}var At={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Dt(t,e,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=t.split(/(\+|\-)/).map(function(t){return t.trim()}),a=s.indexOf(dt(s,function(t){return-1!==t.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==a?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return(c=c.map(function(t,i){var r=(1===i?!o:o)?"height":"width",s=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,s=!0,t):s?(t[t.length-1]+=e,s=!1,t):t.concat(e)},[]).map(function(t){return function(t,e,n,i){var r=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return t;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return rt(a)[e]/100*o}if("vh"===s||"vw"===s)return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(t,r,e,n)})})).forEach(function(t,e){t.forEach(function(n,i){yt(n)&&(r[e]+=n*("-"===t[i-1]?-1:1))})}),r}var St={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var r=t.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),l=a?"left":"top",c=a?"width":"height",h={start:nt({},l,o[l]),end:nt({},l,o[l]+o[c]-s[c])};t.offsets.popper=it({},s,h[i])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,i=t.placement,r=t.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],l=void 0;return l=yt(+n)?[+n,0]:Dt(n,o,s,a),"left"===a?(o.top+=l[0],o.left-=l[1]):"right"===a?(o.top+=l[0],o.left+=l[1]):"top"===a?(o.left+=l[0],o.top-=l[1]):"bottom"===a&&(o.left+=l[0],o.top+=l[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||Q(t.instance.popper);t.instance.reference===n&&(n=Q(n));var i=at(t.instance.popper,t.instance.reference,e.padding,n);e.boundaries=i;var r=e.priority,o=t.offsets.popper,s={primary:function(t){var n=o[t];return o[t]i[t]&&!e.escapeWithReference&&(r=Math.min(o[n],i[t]-("right"===t?o.width:o.height))),nt({},n,r)}};return r.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";o=it({},o,s[e](t))}),t.offsets.popper=o,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,r=t.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]o(i[a])&&(t.offsets.popper[l]=o(i[a])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!Tt(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var r=t.placement.split("-")[0],o=t.offsets,s=o.popper,a=o.reference,l=-1!==["left","right"].indexOf(r),c=l?"height":"width",h=l?"Top":"Left",f=h.toLowerCase(),u=l?"left":"top",d=l?"bottom":"right",p=ht(i)[c];a[d]-ps[d]&&(t.offsets.popper[f]+=a[f]+p-s[d]),t.offsets.popper=rt(t.offsets.popper);var g=a[f]+a[c]/2-p/2,m=F(t.instance.popper),_=parseFloat(m["margin"+h],10),v=parseFloat(m["border"+h+"Width"],10),E=g-t.offsets.popper[f]-_-v;return E=Math.max(Math.min(s[c]-p,E),0),t.arrowElement=i,t.offsets.arrow=(nt(n={},f,Math.round(E)),nt(n,u,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(gt(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=at(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement),i=t.placement.split("-")[0],r=ft(i),o=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case At.FLIP:s=[i,r];break;case At.CLOCKWISE:s=It(i);break;case At.COUNTERCLOCKWISE:s=It(i,!0);break;default:s=e.behavior}return s.forEach(function(a,l){if(i!==a||s.length===l+1)return t;i=t.placement.split("-")[0],r=ft(i);var c,h=t.offsets.popper,f=t.offsets.reference,u=Math.floor,d="left"===i&&u(h.right)>u(f.left)||"right"===i&&u(h.left)u(f.top)||"bottom"===i&&u(h.top)u(n.right),m=u(h.top)u(n.bottom),v="left"===i&&p||"right"===i&&g||"top"===i&&m||"bottom"===i&&_,E=-1!==["top","bottom"].indexOf(i),y=!!e.flipVariations&&(E&&"start"===o&&p||E&&"end"===o&&g||!E&&"start"===o&&m||!E&&"end"===o&&_);(d||v||y)&&(t.flipped=!0,(d||v)&&(i=s[l+1]),y&&(o="end"===(c=o)?"start":"start"===c?"end":c),t.placement=i+(o?"-"+o:""),t.offsets.popper=it({},t.offsets.popper,ut(t.instance.popper,t.offsets.reference,t.placement)),t=pt(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,r=i.popper,o=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[s?"left":"top"]=o[n]-(a?r[s?"width":"height"]:0),t.placement=ft(e),t.offsets.popper=rt(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!Tt(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=dt(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};tt(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=U(this.update.bind(this)),this.options=it({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(it({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=it({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return it({name:t},i.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&B(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return et(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=ct(this.state,this.popper,this.reference),t.placement=lt(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.offsets.popper=ut(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position="absolute",t=pt(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,gt(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[mt("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=vt(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return Et.call(this)}}]),t}();Ot.Utils=("undefined"!=typeof window?window:global).PopperUtils,Ot.placements=Ct,Ot.Defaults=St;var Nt=function(t){var e="dropdown",n="bs.dropdown",o="."+n,s=t.fn[e],a=new RegExp("38|40|27"),l={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,CLICK:"click"+o,CLICK_DATA_API:"click"+o+".data-api",KEYDOWN_DATA_API:"keydown"+o+".data-api",KEYUP_DATA_API:"keyup"+o+".data-api"},c="disabled",h="show",f="dropup",u="dropright",d="dropleft",p="dropdown-menu-right",g="dropdown-menu-left",m="position-static",_='[data-toggle="dropdown"]',v=".dropdown form",E=".dropdown-menu",y=".navbar-nav",b=".dropdown-menu .dropdown-item:not(.disabled)",T="top-start",C="top-end",w="bottom-start",I="bottom-end",A="right-start",D="left-start",S={offset:0,flip:!0,boundary:"scrollParent"},O={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)"},N=function(){function s(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var v=s.prototype;return v.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(c)){var e=s._getParentFromElement(this._element),n=t(this._menu).hasClass(h);if(s._clearMenus(),!n){var i={relatedTarget:this._element},r=t.Event(l.SHOW,i);if(t(e).trigger(r),!r.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof Ot)throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var o=this._element;t(e).hasClass(f)&&(t(this._menu).hasClass(g)||t(this._menu).hasClass(p))&&(o=e),"scrollParent"!==this._config.boundary&&t(e).addClass(m),this._popper=new Ot(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===t(e).closest(y).length&&t("body").children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(h),t(e).toggleClass(h).trigger(t.Event(l.SHOWN,i))}}}},v.dispose=function(){t.removeData(this._element,n),t(this._element).off(o),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},v.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},v._addEventListeners=function(){var e=this;t(this._element).on(l.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},v._getConfig=function(n){return n=r({},this.constructor.Default,t(this._element).data(),n),k.typeCheckConfig(e,n,this.constructor.DefaultType),n},v._getMenuElement=function(){if(!this._menu){var e=s._getParentFromElement(this._element);this._menu=t(e).find(E)[0]}return this._menu},v._getPlacement=function(){var e=t(this._element).parent(),n=w;return e.hasClass(f)?(n=T,t(this._menu).hasClass(p)&&(n=C)):e.hasClass(u)?n=A:e.hasClass(d)?n=D:t(this._menu).hasClass(p)&&(n=I),n},v._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},v._getPopperConfig=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets)||{}),e}:e.offset=this._config.offset,{placement:this._getPlacement(),modifiers:{offset:e,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}}},s._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n);if(i||(i=new s(this,"object"==typeof e?e:null),t(this).data(n,i)),"string"==typeof e){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},s._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var i=t.makeArray(t(_)),r=0;r0&&o--,40===e.which&&odocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},g._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},g._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},f="show",u="out",d={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},p="fade",g="show",m=".tooltip-inner",_=".arrow",v="hover",E="focus",y="click",b="manual",T=function(){function s(t,e){if("undefined"==typeof Ot)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var T=s.prototype;return T.enable=function(){this._isEnabled=!0},T.disable=function(){this._isEnabled=!1},T.toggleEnabled=function(){this._isEnabled=!this._isEnabled},T.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(g))return void this._leave(null,this);this._enter(null,this)}},T.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},T.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var r=this.getTipElement(),o=k.getUID(this.constructor.NAME);r.setAttribute("id",o),this.element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&t(r).addClass(p);var a="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,l=this._getAttachment(a);this.addAttachmentClass(l);var c=!1===this.config.container?document.body:t(this.config.container);t(r).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(r).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Ot(this.element,r,{placement:l,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:_},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(r).addClass(g),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var h=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===u&&e._leave(null,e)};k.supportsTransitionEnd()&&t(this.tip).hasClass(p)?t(this.tip).one(k.TRANSITION_END,h).emulateTransitionEnd(s._TRANSITION_DURATION):h()}},T.hide=function(e){var n=this,i=this.getTipElement(),r=t.Event(this.constructor.Event.HIDE),o=function(){n._hoverState!==f&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(r),r.isDefaultPrevented()||(t(i).removeClass(g),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[y]=!1,this._activeTrigger[E]=!1,this._activeTrigger[v]=!1,k.supportsTransitionEnd()&&t(this.tip).hasClass(p)?t(i).one(k.TRANSITION_END,o).emulateTransitionEnd(150):o(),this._hoverState="")},T.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},T.isWithContent=function(){return Boolean(this.getTitle())},T.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},T.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},T.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(m),this.getTitle()),e.removeClass(p+" "+g)},T.setElementContent=function(e,n){var i=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?i?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[i?"html":"text"](n)},T.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},T._getAttachment=function(t){return c[t.toUpperCase()]},T._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==b){var i=n===v?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,r=n===v?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(r,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},T._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},T._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?E:v]=!0),t(n.getTipElement()).hasClass(g)||n._hoverState===f?n._hoverState=f:(clearTimeout(n._timeout),n._hoverState=f,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===f&&n.show()},n.config.delay.show):n.show())},T._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?E:v]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=u,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===u&&n.hide()},n.config.delay.hide):n.hide())},T._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},T._getConfig=function(n){return"number"==typeof(n=r({},this.constructor.Default,t(this.element).data(),n)).delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),k.typeCheckConfig(e,n,this.constructor.DefaultType),n},T._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},T._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},T._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},T._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},s._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),r="object"==typeof e&&e;if((i||!/dispose|hide/.test(e))&&(i||(i=new s(this,r),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},i(s,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return h}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return d}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return l}}]),s}();return t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=s,T._jQueryInterface},T}(e),Pt=function(t){var e="popover",n="bs.popover",o="."+n,s=t.fn[e],a=new RegExp("(^|\\s)bs-popover\\S+","g"),l=r({},Lt.Default,{placement:"right",trigger:"click",content:"",template:''}),c=r({},Lt.DefaultType,{content:"(string|element|function)"}),h="fade",f="show",u=".popover-header",d=".popover-body",p={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},g=function(r){var s,g;function m(){return r.apply(this,arguments)||this}g=r,(s=m).prototype=Object.create(g.prototype),s.prototype.constructor=s,s.__proto__=g;var _=m.prototype;return _.isWithContent=function(){return this.getTitle()||this._getContent()},_.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-popover-"+e)},_.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},_.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(u),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(d),n),e.removeClass(h+" "+f)},_._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},_._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},m._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),r="object"==typeof e?e:null;if((i||!/destroy|hide/.test(e))&&(i||(i=new m(this,r),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},i(m,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return c}}]),m}(Lt);return t.fn[e]=g._jQueryInterface,t.fn[e].Constructor=g,t.fn[e].noConflict=function(){return t.fn[e]=s,g._jQueryInterface},g}(e),xt=function(t){var e="scrollspy",n="bs.scrollspy",o="."+n,s=t.fn[e],a={offset:10,method:"auto",target:""},l={offset:"number",method:"string",target:"(string|element)"},c={ACTIVATE:"activate"+o,SCROLL:"scroll"+o,LOAD_DATA_API:"load"+o+".data-api"},h="dropdown-item",f="active",u={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},d="offset",p="position",g=function(){function s(e,n){var i=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+u.NAV_LINKS+","+this._config.target+" "+u.LIST_ITEMS+","+this._config.target+" "+u.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(c.SCROLL,function(t){return i._process(t)}),this.refresh(),this._process()}var g=s.prototype;return g.refresh=function(){var e=this,n=this._scrollElement===this._scrollElement.window?d:p,i="auto"===this._config.method?n:this._config.method,r=i===p?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n,o=k.getSelectorFromElement(e);if(o&&(n=t(o)[0]),n){var s=n.getBoundingClientRect();if(s.width||s.height)return[t(n)[i]().top+r,o]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},g.dispose=function(){t.removeData(this._element,n),t(this._scrollElement).off(o),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},g._getConfig=function(n){if("string"!=typeof(n=r({},a,n)).target){var i=t(n.target).attr("id");i||(i=k.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return k.typeCheckConfig(e,n,l),n},g._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},g._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},g._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},g._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;){this._activeTarget!==this._targets[r]&&t>=this._offsets[r]&&("undefined"==typeof this._offsets[r+1]||t li > .active",p='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',g=".dropdown-toggle",m="> .dropdown-menu .active",_=function(){function e(t){this._element=t}var n=e.prototype;return n.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(s)||t(this._element).hasClass(a))){var n,i,o=t(this._element).closest(f)[0],l=k.getSelectorFromElement(this._element);if(o){var c="UL"===o.nodeName?d:u;i=(i=t.makeArray(t(o).find(c)))[i.length-1]}var h=t.Event(r.HIDE,{relatedTarget:this._element}),p=t.Event(r.SHOW,{relatedTarget:i});if(i&&t(i).trigger(h),t(this._element).trigger(p),!p.isDefaultPrevented()&&!h.isDefaultPrevented()){l&&(n=t(l)[0]),this._activate(this._element,o);var g=function(){var n=t.Event(r.HIDDEN,{relatedTarget:e._element}),o=t.Event(r.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,g):g()}}},n.dispose=function(){t.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(e,n,i){var r=this,o=("UL"===n.nodeName?t(n).find(d):t(n).children(u))[0],s=i&&k.supportsTransitionEnd()&&o&&t(o).hasClass(l),a=function(){return r._transitionComplete(e,o,i)};o&&s?t(o).one(k.TRANSITION_END,a).emulateTransitionEnd(150):a()},n._transitionComplete=function(e,n,i){if(n){t(n).removeClass(c+" "+s);var r=t(n.parentNode).find(m)[0];r&&t(r).removeClass(s),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(t(e).addClass(s),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),k.reflow(e),t(e).addClass(c),e.parentNode&&t(e.parentNode).hasClass(o)){var a=t(e).closest(h)[0];a&&t(a).find(g).addClass(s),e.setAttribute("aria-expanded",!0)}i&&i()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),r=i.data("bs.tab");if(r||(r=new e(this),i.data("bs.tab",r)),"string"==typeof n){if("undefined"==typeof r[n])throw new TypeError('No method named "'+n+'"');r[n]()}})},i(e,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),e}();return t(document).on(r.CLICK_DATA_API,p,function(e){e.preventDefault(),_._jQueryInterface.call(t(this),"show")}),t.fn.tab=_._jQueryInterface,t.fn.tab.Constructor=_,t.fn.tab.noConflict=function(){return t.fn.tab=n,_._jQueryInterface},_}(e);!function(t){if("undefined"==typeof t)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1===e[0]&&9===e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(e),t.Util=k,t.Alert=L,t.Button=P,t.Carousel=x,t.Collapse=R,t.Dropdown=Nt,t.Modal=kt,t.Popover=Pt,t.Scrollspy=xt,t.Tab=Rt,t.Tooltip=Lt,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file diff --git a/examples/libs/bootstrap.js b/examples/libs/bootstrap.js index 241d11b..8a2e99a 100644 --- a/examples/libs/bootstrap.js +++ b/examples/libs/bootstrap.js @@ -1,4494 +1,2377 @@ /*! - * Bootstrap v5.3.3 (https://getbootstrap.com/) - * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) : - typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper)); -})(this, (function (Popper) { 'use strict'; - - function _interopNamespaceDefault(e) { - const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); - if (e) { - for (const k in e) { - if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: () => e[k] - }); - } - } - } - n.default = e; - return Object.freeze(n); + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ + +if (typeof jQuery === 'undefined') { + throw new Error('Bootstrap\'s JavaScript requires jQuery') +} + ++function ($) { + 'use strict'; + var version = $.fn.jquery.split(' ')[0].split('.') + if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { + throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') } +}(jQuery); - const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper); +/* ======================================================================== + * Bootstrap: transition.js v3.3.7 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - /** - * -------------------------------------------------------------------------- - * Bootstrap dom/data.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - /** - * Constants - */ ++function ($) { + 'use strict'; - const elementMap = new Map(); - const Data = { - set(element, key, instance) { - if (!elementMap.has(element)) { - elementMap.set(element, new Map()); - } - const instanceMap = elementMap.get(element); - - // make it clear we only want one instance per element - // can be removed later when multiple key/instances are fine to be used - if (!instanceMap.has(key) && instanceMap.size !== 0) { - // eslint-disable-next-line no-console - console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); - return; - } - instanceMap.set(key, instance); - }, - get(element, key) { - if (elementMap.has(element)) { - return elementMap.get(element).get(key) || null; - } - return null; - }, - remove(element, key) { - if (!elementMap.has(element)) { - return; - } - const instanceMap = elementMap.get(element); - instanceMap.delete(key); + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ - // free up element references if there are no instances left for an element - if (instanceMap.size === 0) { - elementMap.delete(element); - } - } - }; - - /** - * -------------------------------------------------------------------------- - * Bootstrap util/index.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - const MAX_UID = 1000000; - const MILLISECONDS_MULTIPLIER = 1000; - const TRANSITION_END = 'transitionend'; - - /** - * Properly escape IDs selectors to handle weird IDs - * @param {string} selector - * @returns {string} - */ - const parseSelector = selector => { - if (selector && window.CSS && window.CSS.escape) { - // document.querySelector needs escaping to handle IDs (html5+) containing for instance / - selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`); - } - return selector; - }; + function transitionEnd() { + var el = document.createElement('bootstrap') - // Shout-out Angus Croll (https://goo.gl/pxwQGp) - const toType = object => { - if (object === null || object === undefined) { - return `${object}`; - } - return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); - }; - - /** - * Public Util API - */ - - const getUID = prefix => { - do { - prefix += Math.floor(Math.random() * MAX_UID); - } while (document.getElementById(prefix)); - return prefix; - }; - const getTransitionDurationFromElement = element => { - if (!element) { - return 0; + var transEndEventNames = { + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' } - // Get transition-duration of the element - let { - transitionDuration, - transitionDelay - } = window.getComputedStyle(element); - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); - - // Return 0 if element or transition duration is not found - if (!floatTransitionDuration && !floatTransitionDelay) { - return 0; + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } } - // If multiple durations are defined, take the first - transitionDuration = transitionDuration.split(',')[0]; - transitionDelay = transitionDelay.split(',')[0]; - return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; - }; - const triggerTransitionEnd = element => { - element.dispatchEvent(new Event(TRANSITION_END)); - }; - const isElement = object => { - if (!object || typeof object !== 'object') { - return false; - } - if (typeof object.jquery !== 'undefined') { - object = object[0]; - } - return typeof object.nodeType !== 'undefined'; - }; - const getElement = object => { - // it's a jQuery object or a node element - if (isElement(object)) { - return object.jquery ? object[0] : object; - } - if (typeof object === 'string' && object.length > 0) { - return document.querySelector(parseSelector(object)); - } - return null; - }; - const isVisible = element => { - if (!isElement(element) || element.getClientRects().length === 0) { - return false; - } - const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; - // Handle `details` element as its content may falsie appear visible when it is closed - const closedDetails = element.closest('details:not([open])'); - if (!closedDetails) { - return elementIsVisible; - } - if (closedDetails !== element) { - const summary = element.closest('summary'); - if (summary && summary.parentNode !== closedDetails) { - return false; - } - if (summary === null) { - return false; + return false // explicit for ie8 ( ._.) + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + + if (!$.support.transition) return + + $.event.special.bsTransitionEnd = { + bindType: $.support.transition.end, + delegateType: $.support.transition.end, + handle: function (e) { + if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) } } - return elementIsVisible; - }; - const isDisabled = element => { - if (!element || element.nodeType !== Node.ELEMENT_NODE) { - return true; - } - if (element.classList.contains('disabled')) { - return true; - } - if (typeof element.disabled !== 'undefined') { - return element.disabled; - } - return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; - }; - const findShadowRoot = element => { - if (!document.documentElement.attachShadow) { - return null; - } + }) - // Can find the shadow root otherwise it'll return the document - if (typeof element.getRootNode === 'function') { - const root = element.getRootNode(); - return root instanceof ShadowRoot ? root : null; - } - if (element instanceof ShadowRoot) { - return element; +}(jQuery); + +/* ======================================================================== + * Bootstrap: alert.js v3.3.7 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.VERSION = '3.3.7' + + Alert.TRANSITION_DURATION = 150 + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - // when we don't find a shadow root - if (!element.parentNode) { - return null; + var $parent = $(selector === '#' ? [] : selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.closest('.alert') } - return findShadowRoot(element.parentNode); - }; - const noop = () => {}; - - /** - * Trick to restart an element's animation - * - * @param {HTMLElement} element - * @return void - * - * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation - */ - const reflow = element => { - element.offsetHeight; // eslint-disable-line no-unused-expressions - }; - const getjQuery = () => { - if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { - return window.jQuery; + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } - return null; - }; - const DOMContentLoadedCallbacks = []; - const onDOMContentLoaded = callback => { - if (document.readyState === 'loading') { - // add listener on the first call when the document is in loading state - if (!DOMContentLoadedCallbacks.length) { - document.addEventListener('DOMContentLoaded', () => { - for (const callback of DOMContentLoadedCallbacks) { - callback(); - } - }); + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one('bsTransitionEnd', removeElement) + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + var old = $.fn.alert + + $.fn.alert = Plugin + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.3.7 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + Button.VERSION = '3.3.7' + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state += 'Text' + + if (data.resetText == null) $el.data('resetText', $el[val]()) + + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + $el[val](data[state] == null ? this.options[state] : data[state]) + + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d).prop(d, true) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d).prop(d, false) } - DOMContentLoadedCallbacks.push(callback); + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked')) changed = false + $parent.find('.active').removeClass('active') + this.$element.addClass('active') + } else if ($input.prop('type') == 'checkbox') { + if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false + this.$element.toggleClass('active') + } + $input.prop('checked', this.$element.hasClass('active')) + if (changed) $input.trigger('change') } else { - callback(); + this.$element.attr('aria-pressed', !this.$element.hasClass('active')) + this.$element.toggleClass('active') } - }; - const isRTL = () => document.documentElement.dir === 'rtl'; - const defineJQueryPlugin = plugin => { - onDOMContentLoaded(() => { - const $ = getjQuery(); - /* istanbul ignore if */ - if ($) { - const name = plugin.NAME; - const JQUERY_NO_CONFLICT = $.fn[name]; - $.fn[name] = plugin.jQueryInterface; - $.fn[name].Constructor = plugin; - $.fn[name].noConflict = () => { - $.fn[name] = JQUERY_NO_CONFLICT; - return plugin.jQueryInterface; - }; - } - }); - }; - const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => { - return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue; - }; - const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { - if (!waitForTransition) { - execute(callback); - return; - } - const durationPadding = 5; - const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; - let called = false; - const handler = ({ - target - }) => { - if (target !== transitionElement) { - return; - } - called = true; - transitionElement.removeEventListener(TRANSITION_END, handler); - execute(callback); - }; - transitionElement.addEventListener(TRANSITION_END, handler); - setTimeout(() => { - if (!called) { - triggerTransitionEnd(transitionElement); - } - }, emulatedDuration); - }; - - /** - * Return the previous/next element of a list. - * - * @param {array} list The list of elements - * @param activeElement The active element - * @param shouldGetNext Choose to get next or previous element - * @param isCycleAllowed - * @return {Element|elem} The proper element - */ - const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { - const listLength = list.length; - let index = list.indexOf(activeElement); - - // if the element does not exist in the list return an element - // depending on the direction and if cycle is allowed - if (index === -1) { - return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]; - } - index += shouldGetNext ? 1 : -1; - if (isCycleAllowed) { - index = (index + listLength) % listLength; - } - return list[Math.max(0, Math.min(index, listLength - 1))]; - }; - - /** - * -------------------------------------------------------------------------- - * Bootstrap dom/event-handler.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const namespaceRegex = /[^.]*(?=\..*)\.|.*/; - const stripNameRegex = /\..*/; - const stripUidRegex = /::\d+$/; - const eventRegistry = {}; // Events storage - let uidEvent = 1; - const customEvents = { - mouseenter: 'mouseover', - mouseleave: 'mouseout' - }; - const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); - - /** - * Private methods - */ - - function makeEventUid(element, uid) { - return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; } - function getElementEvents(element) { - const uid = makeEventUid(element); - element.uidEvent = uid; - eventRegistry[uid] = eventRegistry[uid] || {}; - return eventRegistry[uid]; + + + // BUTTON PLUGIN DEFINITION + // ======================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) } - function bootstrapHandler(element, fn) { - return function handler(event) { - hydrateObj(event, { - delegateTarget: element - }); - if (handler.oneOff) { - EventHandler.off(element, event.type, fn); - } - return fn.apply(element, [event]); - }; + + var old = $.fn.button + + $.fn.button = Plugin + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this } - function bootstrapDelegationHandler(element, selector, fn) { - return function handler(event) { - const domElements = element.querySelectorAll(selector); - for (let { - target - } = event; target && target !== this; target = target.parentNode) { - for (const domElement of domElements) { - if (domElement !== target) { - continue; - } - hydrateObj(event, { - delegateTarget: target - }); - if (handler.oneOff) { - EventHandler.off(element, event.type, selector, fn); - } - return fn.apply(target, [event]); - } - } - }; + + + // BUTTON DATA-API + // =============== + + $(document) + .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { + var $btn = $(e.target).closest('.btn') + Plugin.call($btn, 'toggle') + if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { + // Prevent double click on radios, and the double selections (so cancellation) on checkboxes + e.preventDefault() + // The target component still receive the focus + if ($btn.is('input,button')) $btn.trigger('focus') + else $btn.find('input:visible,button:visible').first().trigger('focus') + } + }) + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { + $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.3.7 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = null + this.sliding = null + this.interval = null + this.$active = null + this.$items = null + + this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) + + this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element + .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) + .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } - function findHandler(events, callable, delegationSelector = null) { - return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); + + Carousel.VERSION = '3.3.7' + + Carousel.TRANSITION_DURATION = 600 + + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true, + keyboard: true } - function normalizeParameters(originalTypeEvent, handler, delegationFunction) { - const isDelegated = typeof handler === 'string'; - // TODO: tooltip passes `false` instead of selector, so we need to check - const callable = isDelegated ? delegationFunction : handler || delegationFunction; - let typeEvent = getTypeEvent(originalTypeEvent); - if (!nativeEvents.has(typeEvent)) { - typeEvent = originalTypeEvent; + + Carousel.prototype.keydown = function (e) { + if (/input|textarea/i.test(e.target.tagName)) return + switch (e.which) { + case 37: this.prev(); break + case 39: this.next(); break + default: return } - return [isDelegated, callable, typeEvent]; + + e.preventDefault() } - function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) { - if (typeof originalTypeEvent !== 'string' || !element) { - return; - } - let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); - - // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position - // this prevents the handler from being dispatched the same way as mouseover or mouseout does - if (originalTypeEvent in customEvents) { - const wrapFunction = fn => { - return function (event) { - if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { - return fn.call(this, event); - } - }; - }; - callable = wrapFunction(callable); - } - const events = getElementEvents(element); - const handlers = events[typeEvent] || (events[typeEvent] = {}); - const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); - if (previousFunction) { - previousFunction.oneOff = previousFunction.oneOff && oneOff; - return; - } - const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); - const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); - fn.delegationSelector = isDelegated ? handler : null; - fn.callable = callable; - fn.oneOff = oneOff; - fn.uidEvent = uid; - handlers[uid] = fn; - element.addEventListener(typeEvent, fn, isDelegated); + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this } - function removeHandler(element, events, typeEvent, handler, delegationSelector) { - const fn = findHandler(events[typeEvent], handler, delegationSelector); - if (!fn) { - return; - } - element.removeEventListener(typeEvent, fn, Boolean(delegationSelector)); - delete events[typeEvent][fn.uidEvent]; + + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) } - function removeNamespacedHandlers(element, events, typeEvent, namespace) { - const storeElementEvent = events[typeEvent] || {}; - for (const [handlerKey, event] of Object.entries(storeElementEvent)) { - if (handlerKey.includes(namespace)) { - removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); - } - } + + Carousel.prototype.getItemForDirection = function (direction, active) { + var activeIndex = this.getItemIndex(active) + var willWrap = (direction == 'prev' && activeIndex === 0) + || (direction == 'next' && activeIndex == (this.$items.length - 1)) + if (willWrap && !this.options.wrap) return active + var delta = direction == 'prev' ? -1 : 1 + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) } - function getTypeEvent(event) { - // allow to get the native events from namespaced events ('click.bs.button' --> 'click') - event = event.replace(stripNameRegex, ''); - return customEvents[event] || event; + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } - const EventHandler = { - on(element, event, handler, delegationFunction) { - addHandler(element, event, handler, delegationFunction, false); - }, - one(element, event, handler, delegationFunction) { - addHandler(element, event, handler, delegationFunction, true); - }, - off(element, originalTypeEvent, handler, delegationFunction) { - if (typeof originalTypeEvent !== 'string' || !element) { - return; - } - const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); - const inNamespace = typeEvent !== originalTypeEvent; - const events = getElementEvents(element); - const storeElementEvent = events[typeEvent] || {}; - const isNamespace = originalTypeEvent.startsWith('.'); - if (typeof callable !== 'undefined') { - // Simplest case: handler is passed, remove that listener ONLY. - if (!Object.keys(storeElementEvent).length) { - return; - } - removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null); - return; - } - if (isNamespace) { - for (const elementEvent of Object.keys(events)) { - removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); - } - } - for (const [keyHandlers, event] of Object.entries(storeElementEvent)) { - const handlerKey = keyHandlers.replace(stripUidRegex, ''); - if (!inNamespace || originalTypeEvent.includes(handlerKey)) { - removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); - } - } - }, - trigger(element, event, args) { - if (typeof event !== 'string' || !element) { - return null; - } - const $ = getjQuery(); - const typeEvent = getTypeEvent(event); - const inNamespace = event !== typeEvent; - let jQueryEvent = null; - let bubbles = true; - let nativeDispatch = true; - let defaultPrevented = false; - if (inNamespace && $) { - jQueryEvent = $.Event(event, args); - $(element).trigger(jQueryEvent); - bubbles = !jQueryEvent.isPropagationStopped(); - nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); - defaultPrevented = jQueryEvent.isDefaultPrevented(); - } - const evt = hydrateObj(new Event(event, { - bubbles, - cancelable: true - }), args); - if (defaultPrevented) { - evt.preventDefault(); - } - if (nativeDispatch) { - element.dispatchEvent(evt); - } - if (evt.defaultPrevented && jQueryEvent) { - jQueryEvent.preventDefault(); - } - return evt; - } - }; - function hydrateObj(obj, meta = {}) { - for (const [key, value] of Object.entries(meta)) { - try { - obj[key] = value; - } catch (_unused) { - Object.defineProperty(obj, key, { - configurable: true, - get() { - return value; - } - }); - } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) } - return obj; + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') } - /** - * -------------------------------------------------------------------------- - * Bootstrap dom/manipulator.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } - function normalizeData(value) { - if (value === 'true') { - return true; - } - if (value === 'false') { - return false; - } - if (value === Number(value).toString()) { - return Number(value); - } - if (value === '' || value === 'null') { - return null; - } - if (typeof value !== 'string') { - return value; - } - try { - return JSON.parse(decodeURIComponent(value)); - } catch (_unused) { - return value; + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || this.getItemForDirection(type, $active) + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var that = this + + if ($next.hasClass('active')) return (this.sliding = false) + + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') + } + + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one('bsTransitionEnd', function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) + }) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger(slidEvent) } + + isCycling && this.cycle() + + return this } - function normalizeDataKey(key) { - return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) } - const Manipulator = { - setDataAttribute(element, key, value) { - element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); - }, - removeDataAttribute(element, key) { - element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); - }, - getDataAttributes(element) { - if (!element) { - return {}; - } - const attributes = {}; - const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); - for (const key of bsKeys) { - let pureKey = key.replace(/^bs/, ''); - pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); - attributes[pureKey] = normalizeData(element.dataset[key]); - } - return attributes; - }, - getDataAttribute(element, key) { - return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); - } - }; - /** - * -------------------------------------------------------------------------- - * Bootstrap util/config.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + var old = $.fn.carousel + $.fn.carousel = Plugin + $.fn.carousel.Constructor = Carousel - /** - * Class definition - */ - class Config { - // Getters - static get Default() { - return {}; - } - static get DefaultType() { - return {}; - } - static get NAME() { - throw new Error('You have to implement the static method "NAME", for each component!'); - } - _getConfig(config) { - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - return config; - } - _mergeConfigObj(config, element) { - const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse - - return { - ...this.constructor.Default, - ...(typeof jsonConfig === 'object' ? jsonConfig : {}), - ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}), - ...(typeof config === 'object' ? config : {}) - }; - } - _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { - for (const [property, expectedTypes] of Object.entries(configTypes)) { - const value = config[property]; - const valueType = isElement(value) ? 'element' : toType(value); - if (!new RegExp(expectedTypes).test(valueType)) { - throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); - } - } + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + var clickHandler = function (e) { + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + Plugin.call($target, options) + + if (slideIndex) { + $target.data('bs.carousel').to(slideIndex) } + + e.preventDefault() } - /** - * -------------------------------------------------------------------------- - * Bootstrap base-component.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + $(document) + .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) + .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + Plugin.call($carousel, $carousel.data()) + }) + }) - /** - * Constants - */ +}(jQuery); - const VERSION = '5.3.3'; +/* ======================================================================== + * Bootstrap: collapse.js v3.3.7 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - /** - * Class definition - */ +/* jshint latedef: false */ - class BaseComponent extends Config { - constructor(element, config) { - super(); - element = getElement(element); - if (!element) { - return; - } - this._element = element; - this._config = this._getConfig(config); - Data.set(this._element, this.constructor.DATA_KEY, this); - } ++function ($) { + 'use strict'; - // Public - dispose() { - Data.remove(this._element, this.constructor.DATA_KEY); - EventHandler.off(this._element, this.constructor.EVENT_KEY); - for (const propertyName of Object.getOwnPropertyNames(this)) { - this[propertyName] = null; - } - } - _queueCallback(callback, element, isAnimated = true) { - executeAfterTransition(callback, element, isAnimated); - } - _getConfig(config) { - config = this._mergeConfigObj(config, this._element); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ - // Static - static getInstance(element) { - return Data.get(getElement(element), this.DATA_KEY); - } - static getOrCreateInstance(element, config = {}) { - return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); - } - static get VERSION() { - return VERSION; - } - static get DATA_KEY() { - return `bs.${this.NAME}`; - } - static get EVENT_KEY() { - return `.${this.DATA_KEY}`; - } - static eventName(name) { - return `${name}${this.EVENT_KEY}`; + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + + '[data-toggle="collapse"][data-target="#' + element.id + '"]') + this.transitioning = null + + if (this.options.parent) { + this.$parent = this.getParent() + } else { + this.addAriaAndCollapsedClass(this.$element, this.$trigger) } + + if (this.options.toggle) this.toggle() } - /** - * -------------------------------------------------------------------------- - * Bootstrap dom/selector-engine.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - const getSelector = element => { - let selector = element.getAttribute('data-bs-target'); - if (!selector || selector === '#') { - let hrefAttribute = element.getAttribute('href'); - - // The only valid content that could double as a selector are IDs or classes, - // so everything starting with `#` or `.`. If a "real" URL is used as the selector, - // `document.querySelector` will rightfully complain it is invalid. - // See https://github.com/twbs/bootstrap/issues/32273 - if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) { - return null; - } + Collapse.VERSION = '3.3.7' - // Just in case some CMS puts out a full URL with the anchor appended - if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { - hrefAttribute = `#${hrefAttribute.split('#')[1]}`; - } - selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null; - } - return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null; - }; - const SelectorEngine = { - find(selector, element = document.documentElement) { - return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); - }, - findOne(selector, element = document.documentElement) { - return Element.prototype.querySelector.call(element, selector); - }, - children(element, selector) { - return [].concat(...element.children).filter(child => child.matches(selector)); - }, - parents(element, selector) { - const parents = []; - let ancestor = element.parentNode.closest(selector); - while (ancestor) { - parents.push(ancestor); - ancestor = ancestor.parentNode.closest(selector); - } - return parents; - }, - prev(element, selector) { - let previous = element.previousElementSibling; - while (previous) { - if (previous.matches(selector)) { - return [previous]; - } - previous = previous.previousElementSibling; - } - return []; - }, - // TODO: this is now unused; remove later along with prev() - next(element, selector) { - let next = element.nextElementSibling; - while (next) { - if (next.matches(selector)) { - return [next]; - } - next = next.nextElementSibling; - } - return []; - }, - focusableChildren(element) { - const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); - return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); - }, - getSelectorFromElement(element) { - const selector = getSelector(element); - if (selector) { - return SelectorEngine.findOne(selector) ? selector : null; - } - return null; - }, - getElementFromSelector(element) { - const selector = getSelector(element); - return selector ? SelectorEngine.findOne(selector) : null; - }, - getMultipleElementsFromSelector(element) { - const selector = getSelector(element); - return selector ? SelectorEngine.find(selector) : []; - } - }; - - /** - * -------------------------------------------------------------------------- - * Bootstrap util/component-functions.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - const enableDismissTrigger = (component, method = 'hide') => { - const clickEvent = `click.dismiss${component.EVENT_KEY}`; - const name = component.NAME; - EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } - if (isDisabled(this)) { - return; - } - const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`); - const instance = component.getOrCreateInstance(target); - - // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method - instance[method](); - }); - }; - - /** - * -------------------------------------------------------------------------- - * Bootstrap alert.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$f = 'alert'; - const DATA_KEY$a = 'bs.alert'; - const EVENT_KEY$b = `.${DATA_KEY$a}`; - const EVENT_CLOSE = `close${EVENT_KEY$b}`; - const EVENT_CLOSED = `closed${EVENT_KEY$b}`; - const CLASS_NAME_FADE$5 = 'fade'; - const CLASS_NAME_SHOW$8 = 'show'; - - /** - * Class definition - */ - - class Alert extends BaseComponent { - // Getters - static get NAME() { - return NAME$f; - } + Collapse.TRANSITION_DURATION = 350 - // Public - close() { - const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); - if (closeEvent.defaultPrevented) { - return; - } - this._element.classList.remove(CLASS_NAME_SHOW$8); - const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); - this._queueCallback(() => this._destroyElement(), this._element, isAnimated); + Collapse.DEFAULTS = { + toggle: true + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var activesData + var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') + + if (actives && actives.length) { + activesData = actives.data('bs.collapse') + if (activesData && activesData.transitioning) return } - // Private - _destroyElement() { - this._element.remove(); - EventHandler.trigger(this._element, EVENT_CLOSED); - this.dispose(); + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + if (actives && actives.length) { + Plugin.call(actives, 'hide') + activesData || actives.data('bs.collapse', null) } - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Alert.getOrCreateInstance(this); - if (typeof config !== 'string') { - return; - } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); - }); + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing')[dimension](0) + .attr('aria-expanded', true) + + this.$trigger + .removeClass('collapsed') + .attr('aria-expanded', true) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('collapse in')[dimension]('') + this.transitioning = 0 + this.$element + .trigger('shown.bs.collapse') } - } - /** - * Data API implementation - */ + if (!$.support.transition) return complete.call(this) - enableDismissTrigger(Alert, 'close'); + var scrollSize = $.camelCase(['scroll', dimension].join('-')) - /** - * jQuery - */ + this.$element + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) + } - defineJQueryPlugin(Alert); + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return - /** - * -------------------------------------------------------------------------- - * Bootstrap button.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + var dimension = this.dimension() - /** - * Constants - */ + this.$element[dimension](this.$element[dimension]())[0].offsetHeight - const NAME$e = 'button'; - const DATA_KEY$9 = 'bs.button'; - const EVENT_KEY$a = `.${DATA_KEY$9}`; - const DATA_API_KEY$6 = '.data-api'; - const CLASS_NAME_ACTIVE$3 = 'active'; - const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; - const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; + this.$element + .addClass('collapsing') + .removeClass('collapse in') + .attr('aria-expanded', false) - /** - * Class definition - */ + this.$trigger + .addClass('collapsed') + .attr('aria-expanded', false) - class Button extends BaseComponent { - // Getters - static get NAME() { - return NAME$e; - } + this.transitioning = 1 - // Public - toggle() { - // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method - this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); + var complete = function () { + this.transitioning = 0 + this.$element + .removeClass('collapsing') + .addClass('collapse') + .trigger('hidden.bs.collapse') } - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Button.getOrCreateInstance(this); - if (config === 'toggle') { - data[config](); - } - }); - } + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } - /** - * Data API implementation - */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { - event.preventDefault(); - const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); - const data = Button.getOrCreateInstance(button); - data.toggle(); - }); - - /** - * jQuery - */ - - defineJQueryPlugin(Button); - - /** - * -------------------------------------------------------------------------- - * Bootstrap util/swipe.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$d = 'swipe'; - const EVENT_KEY$9 = '.bs.swipe'; - const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; - const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; - const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; - const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; - const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; - const POINTER_TYPE_TOUCH = 'touch'; - const POINTER_TYPE_PEN = 'pen'; - const CLASS_NAME_POINTER_EVENT = 'pointer-event'; - const SWIPE_THRESHOLD = 40; - const Default$c = { - endCallback: null, - leftCallback: null, - rightCallback: null - }; - const DefaultType$c = { - endCallback: '(function|null)', - leftCallback: '(function|null)', - rightCallback: '(function|null)' - }; - - /** - * Class definition - */ - - class Swipe extends Config { - constructor(element, config) { - super(); - this._element = element; - if (!element || !Swipe.isSupported()) { - return; - } - this._config = this._getConfig(config); - this._deltaX = 0; - this._supportPointerEvents = Boolean(window.PointerEvent); - this._initEvents(); - } + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } - // Getters - static get Default() { - return Default$c; - } - static get DefaultType() { - return DefaultType$c; - } - static get NAME() { - return NAME$d; - } + Collapse.prototype.getParent = function () { + return $(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each($.proxy(function (i, element) { + var $element = $(element) + this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) + }, this)) + .end() + } - // Public - dispose() { - EventHandler.off(this._element, EVENT_KEY$9); - } + Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { + var isOpen = $element.hasClass('in') - // Private - _start(event) { - if (!this._supportPointerEvents) { - this._deltaX = event.touches[0].clientX; - return; - } - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX; - } - } - _end(event) { - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX - this._deltaX; - } - this._handleSwipe(); - execute(this._config.endCallback); - } - _move(event) { - this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; - } - _handleSwipe() { - const absDeltaX = Math.abs(this._deltaX); - if (absDeltaX <= SWIPE_THRESHOLD) { - return; - } - const direction = absDeltaX / this._deltaX; - this._deltaX = 0; - if (!direction) { - return; - } - execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); - } - _initEvents() { - if (this._supportPointerEvents) { - EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); - EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); - this._element.classList.add(CLASS_NAME_POINTER_EVENT); - } else { - EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); - EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); - EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); - } - } - _eventIsPointerPenTouch(event) { - return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); - } + $element.attr('aria-expanded', isOpen) + $trigger + .toggleClass('collapsed', !isOpen) + .attr('aria-expanded', isOpen) + } - // Static - static isSupported() { - return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; - } + function getTargetFromTrigger($trigger) { + var href + var target = $trigger.attr('data-target') + || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + + return $(target) } - /** - * -------------------------------------------------------------------------- - * Bootstrap carousel.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$c = 'carousel'; - const DATA_KEY$8 = 'bs.carousel'; - const EVENT_KEY$8 = `.${DATA_KEY$8}`; - const DATA_API_KEY$5 = '.data-api'; - const ARROW_LEFT_KEY$1 = 'ArrowLeft'; - const ARROW_RIGHT_KEY$1 = 'ArrowRight'; - const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch - - const ORDER_NEXT = 'next'; - const ORDER_PREV = 'prev'; - const DIRECTION_LEFT = 'left'; - const DIRECTION_RIGHT = 'right'; - const EVENT_SLIDE = `slide${EVENT_KEY$8}`; - const EVENT_SLID = `slid${EVENT_KEY$8}`; - const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`; - const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`; - const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`; - const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`; - const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`; - const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; - const CLASS_NAME_CAROUSEL = 'carousel'; - const CLASS_NAME_ACTIVE$2 = 'active'; - const CLASS_NAME_SLIDE = 'slide'; - const CLASS_NAME_END = 'carousel-item-end'; - const CLASS_NAME_START = 'carousel-item-start'; - const CLASS_NAME_NEXT = 'carousel-item-next'; - const CLASS_NAME_PREV = 'carousel-item-prev'; - const SELECTOR_ACTIVE = '.active'; - const SELECTOR_ITEM = '.carousel-item'; - const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; - const SELECTOR_ITEM_IMG = '.carousel-item img'; - const SELECTOR_INDICATORS = '.carousel-indicators'; - const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; - const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - const KEY_TO_DIRECTION = { - [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT, - [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT - }; - const Default$b = { - interval: 5000, - keyboard: true, - pause: 'hover', - ride: false, - touch: true, - wrap: true - }; - const DefaultType$b = { - interval: '(number|boolean)', - // TODO:v6 remove boolean support - keyboard: 'boolean', - pause: '(string|boolean)', - ride: '(boolean|string)', - touch: 'boolean', - wrap: 'boolean' - }; - - /** - * Class definition - */ - - class Carousel extends BaseComponent { - constructor(element, config) { - super(element, config); - this._interval = null; - this._activeElement = null; - this._isSliding = false; - this.touchTimeout = null; - this._swipeHelper = null; - this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); - this._addEventListeners(); - if (this._config.ride === CLASS_NAME_CAROUSEL) { - this.cycle(); - } - } - // Getters - static get Default() { - return Default$b; - } - static get DefaultType() { - return DefaultType$b; - } - static get NAME() { - return NAME$c; - } + // COLLAPSE PLUGIN DEFINITION + // ========================== - // Public - next() { - this._slide(ORDER_NEXT); - } - nextWhenVisible() { - // FIXME TODO use `document.visibilityState` - // Don't call next when the page isn't visible - // or the carousel or its parent isn't visible - if (!document.hidden && isVisible(this._element)) { - this.next(); - } - } - prev() { - this._slide(ORDER_PREV); - } - pause() { - if (this._isSliding) { - triggerTransitionEnd(this._element); - } - this._clearInterval(); - } - cycle() { - this._clearInterval(); - this._updateInterval(); - this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); - } - _maybeEnableCycle() { - if (!this._config.ride) { - return; - } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); - return; - } - this.cycle(); + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.collapse + + $.fn.collapse = Plugin + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { + var $this = $(this) + + if (!$this.attr('data-target')) e.preventDefault() + + var $target = getTargetFromTrigger($this) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() + + Plugin.call($target, option) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.3.7 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle="dropdown"]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.VERSION = '3.3.7' + + function getParent($this) { + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - to(index) { - const items = this._getItems(); - if (index > items.length - 1 || index < 0) { - return; - } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); - return; - } - const activeIndex = this._getItemIndex(this._getActive()); - if (activeIndex === index) { - return; + + var $parent = selector && $(selector) + + return $parent && $parent.length ? $parent : $this.parent() + } + + function clearMenus(e) { + if (e && e.which === 3) return + $(backdrop).remove() + $(toggle).each(function () { + var $this = $(this) + var $parent = getParent($this) + var relatedTarget = { relatedTarget: this } + + if (!$parent.hasClass('open')) return + + if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return + + $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + + if (e.isDefaultPrevented()) return + + $this.attr('aria-expanded', 'false') + $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) + }) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $(document.createElement('div')) + .addClass('dropdown-backdrop') + .insertAfter($(this)) + .on('click', clearMenus) } - const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; - this._slide(order, items[index]); + + var relatedTarget = { relatedTarget: this } + $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) + + if (e.isDefaultPrevented()) return + + $this + .trigger('focus') + .attr('aria-expanded', 'true') + + $parent + .toggleClass('open') + .trigger($.Event('shown.bs.dropdown', relatedTarget)) } - dispose() { - if (this._swipeHelper) { - this._swipeHelper.dispose(); - } - super.dispose(); + + return false + } + + Dropdown.prototype.keydown = function (e) { + if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return + + var $this = $(this) + + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + if (!isActive && e.which != 27 || isActive && e.which == 27) { + if (e.which == 27) $parent.find(toggle).trigger('focus') + return $this.trigger('click') } - // Private - _configAfterMerge(config) { - config.defaultInterval = config.interval; - return config; + var desc = ' li:not(.disabled):visible a' + var $items = $parent.find('.dropdown-menu' + desc) + + if (!$items.length) return + + var index = $items.index(e.target) + + if (e.which == 38 && index > 0) index-- // up + if (e.which == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items.eq(index).trigger('focus') + } + + + // DROPDOWN PLUGIN DEFINITION + // ========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.dropdown') + + if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + var old = $.fn.dropdown + + $.fn.dropdown = Plugin + $.fn.dropdown.Constructor = Dropdown + + + // DROPDOWN NO CONFLICT + // ==================== + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + + // APPLY TO STANDARD DROPDOWN ELEMENTS + // =================================== + + $(document) + .on('click.bs.dropdown.data-api', clearMenus) + .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) + .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: modal.js v3.3.7 + * http://getbootstrap.com/javascript/#modals + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // MODAL CLASS DEFINITION + // ====================== + + var Modal = function (element, options) { + this.options = options + this.$body = $(document.body) + this.$element = $(element) + this.$dialog = this.$element.find('.modal-dialog') + this.$backdrop = null + this.isShown = null + this.originalBodyPad = null + this.scrollbarWidth = 0 + this.ignoreBackdropClick = false + + if (this.options.remote) { + this.$element + .find('.modal-content') + .load(this.options.remote, $.proxy(function () { + this.$element.trigger('loaded.bs.modal') + }, this)) } - _addEventListeners() { - if (this._config.keyboard) { - EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event)); - } - if (this._config.pause === 'hover') { - EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause()); - EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle()); - } - if (this._config.touch && Swipe.isSupported()) { - this._addTouchEventListeners(); + } + + Modal.VERSION = '3.3.7' + + Modal.TRANSITION_DURATION = 300 + Modal.BACKDROP_TRANSITION_DURATION = 150 + + Modal.DEFAULTS = { + backdrop: true, + keyboard: true, + show: true + } + + Modal.prototype.toggle = function (_relatedTarget) { + return this.isShown ? this.hide() : this.show(_relatedTarget) + } + + Modal.prototype.show = function (_relatedTarget) { + var that = this + var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) + + this.$element.trigger(e) + + if (this.isShown || e.isDefaultPrevented()) return + + this.isShown = true + + this.checkScrollbar() + this.setScrollbar() + this.$body.addClass('modal-open') + + this.escape() + this.resize() + + this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) + + this.$dialog.on('mousedown.dismiss.bs.modal', function () { + that.$element.one('mouseup.dismiss.bs.modal', function (e) { + if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true + }) + }) + + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + if (!that.$element.parent().length) { + that.$element.appendTo(that.$body) // don't move modals dom position } - } - _addTouchEventListeners() { - for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { - EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); + + that.$element + .show() + .scrollTop(0) + + that.adjustDialog() + + if (transition) { + that.$element[0].offsetWidth // force reflow } - const endCallBack = () => { - if (this._config.pause !== 'hover') { - return; - } - // If it's a touch-enabled device, mouseenter/leave are fired as - // part of the mouse compatibility events on first tap - the carousel - // would stop cycling until user tapped out of it; - // here, we listen for touchend, explicitly pause the carousel - // (as if it's the second time we tap on it, mouseenter compat event - // is NOT fired) and after a timeout (to allow for mouse compatibility - // events to fire) we explicitly restart cycling - - this.pause(); - if (this.touchTimeout) { - clearTimeout(this.touchTimeout); + that.$element.addClass('in') + + that.enforceFocus() + + var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) + + transition ? + that.$dialog // wait for modal to slide in + .one('bsTransitionEnd', function () { + that.$element.trigger('focus').trigger(e) + }) + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : + that.$element.trigger('focus').trigger(e) + }) + } + + Modal.prototype.hide = function (e) { + if (e) e.preventDefault() + + e = $.Event('hide.bs.modal') + + this.$element.trigger(e) + + if (!this.isShown || e.isDefaultPrevented()) return + + this.isShown = false + + this.escape() + this.resize() + + $(document).off('focusin.bs.modal') + + this.$element + .removeClass('in') + .off('click.dismiss.bs.modal') + .off('mouseup.dismiss.bs.modal') + + this.$dialog.off('mousedown.dismiss.bs.modal') + + $.support.transition && this.$element.hasClass('fade') ? + this.$element + .one('bsTransitionEnd', $.proxy(this.hideModal, this)) + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : + this.hideModal() + } + + Modal.prototype.enforceFocus = function () { + $(document) + .off('focusin.bs.modal') // guard against infinite focus loop + .on('focusin.bs.modal', $.proxy(function (e) { + if (document !== e.target && + this.$element[0] !== e.target && + !this.$element.has(e.target).length) { + this.$element.trigger('focus') } - this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); - }; - const swipeConfig = { - leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), - rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), - endCallback: endCallBack - }; - this._swipeHelper = new Swipe(this._element, swipeConfig); - } - _keydown(event) { - if (/input|textarea/i.test(event.target.tagName)) { - return; - } - const direction = KEY_TO_DIRECTION[event.key]; - if (direction) { - event.preventDefault(); - this._slide(this._directionToOrder(direction)); - } - } - _getItemIndex(element) { - return this._getItems().indexOf(element); - } - _setActiveIndicatorElement(index) { - if (!this._indicatorsElement) { - return; - } - const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); - activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); - activeIndicator.removeAttribute('aria-current'); - const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); - if (newActiveIndicator) { - newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); - newActiveIndicator.setAttribute('aria-current', 'true'); - } + }, this)) + } + + Modal.prototype.escape = function () { + if (this.isShown && this.options.keyboard) { + this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { + e.which == 27 && this.hide() + }, this)) + } else if (!this.isShown) { + this.$element.off('keydown.dismiss.bs.modal') } - _updateInterval() { - const element = this._activeElement || this._getActive(); - if (!element) { - return; - } - const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); - this._config.interval = elementInterval || this._config.defaultInterval; + } + + Modal.prototype.resize = function () { + if (this.isShown) { + $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) + } else { + $(window).off('resize.bs.modal') } - _slide(order, element = null) { - if (this._isSliding) { - return; - } - const activeElement = this._getActive(); - const isNext = order === ORDER_NEXT; - const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); - if (nextElement === activeElement) { - return; - } - const nextElementIndex = this._getItemIndex(nextElement); - const triggerEvent = eventName => { - return EventHandler.trigger(this._element, eventName, { - relatedTarget: nextElement, - direction: this._orderToDirection(order), - from: this._getItemIndex(activeElement), - to: nextElementIndex - }); - }; - const slideEvent = triggerEvent(EVENT_SLIDE); - if (slideEvent.defaultPrevented) { - return; - } - if (!activeElement || !nextElement) { - // Some weirdness is happening, so we bail - // TODO: change tests that use empty divs to avoid this check - return; - } - const isCycling = Boolean(this._interval); - this.pause(); - this._isSliding = true; - this._setActiveIndicatorElement(nextElementIndex); - this._activeElement = nextElement; - const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; - const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; - nextElement.classList.add(orderClassName); - reflow(nextElement); - activeElement.classList.add(directionalClassName); - nextElement.classList.add(directionalClassName); - const completeCallBack = () => { - nextElement.classList.remove(directionalClassName, orderClassName); - nextElement.classList.add(CLASS_NAME_ACTIVE$2); - activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); - this._isSliding = false; - triggerEvent(EVENT_SLID); - }; - this._queueCallback(completeCallBack, activeElement, this._isAnimated()); - if (isCycling) { - this.cycle(); + } + + Modal.prototype.hideModal = function () { + var that = this + this.$element.hide() + this.backdrop(function () { + that.$body.removeClass('modal-open') + that.resetAdjustments() + that.resetScrollbar() + that.$element.trigger('hidden.bs.modal') + }) + } + + Modal.prototype.removeBackdrop = function () { + this.$backdrop && this.$backdrop.remove() + this.$backdrop = null + } + + Modal.prototype.backdrop = function (callback) { + var that = this + var animate = this.$element.hasClass('fade') ? 'fade' : '' + + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $(document.createElement('div')) + .addClass('modal-backdrop ' + animate) + .appendTo(this.$body) + + this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { + if (this.ignoreBackdropClick) { + this.ignoreBackdropClick = false + return + } + if (e.target !== e.currentTarget) return + this.options.backdrop == 'static' + ? this.$element[0].focus() + : this.hide() + }, this)) + + if (doAnimate) this.$backdrop[0].offsetWidth // force reflow + + this.$backdrop.addClass('in') + + if (!callback) return + + doAnimate ? + this.$backdrop + .one('bsTransitionEnd', callback) + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : + callback() + + } else if (!this.isShown && this.$backdrop) { + this.$backdrop.removeClass('in') + + var callbackRemove = function () { + that.removeBackdrop() + callback && callback() } + $.support.transition && this.$element.hasClass('fade') ? + this.$backdrop + .one('bsTransitionEnd', callbackRemove) + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : + callbackRemove() + + } else if (callback) { + callback() } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_SLIDE); - } - _getActive() { - return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + } + + // these following methods are used to handle overflowing modals + + Modal.prototype.handleUpdate = function () { + this.adjustDialog() + } + + Modal.prototype.adjustDialog = function () { + var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight + + this.$element.css({ + paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', + paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' + }) + } + + Modal.prototype.resetAdjustments = function () { + this.$element.css({ + paddingLeft: '', + paddingRight: '' + }) + } + + Modal.prototype.checkScrollbar = function () { + var fullWindowWidth = window.innerWidth + if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 + var documentElementRect = document.documentElement.getBoundingClientRect() + fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) } - _getItems() { - return SelectorEngine.find(SELECTOR_ITEM, this._element); + this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth + this.scrollbarWidth = this.measureScrollbar() + } + + Modal.prototype.setScrollbar = function () { + var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) + this.originalBodyPad = document.body.style.paddingRight || '' + if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) + } + + Modal.prototype.resetScrollbar = function () { + this.$body.css('padding-right', this.originalBodyPad) + } + + Modal.prototype.measureScrollbar = function () { // thx walsh + var scrollDiv = document.createElement('div') + scrollDiv.className = 'modal-scrollbar-measure' + this.$body.append(scrollDiv) + var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth + this.$body[0].removeChild(scrollDiv) + return scrollbarWidth + } + + + // MODAL PLUGIN DEFINITION + // ======================= + + function Plugin(option, _relatedTarget) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.modal') + var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data) $this.data('bs.modal', (data = new Modal(this, options))) + if (typeof option == 'string') data[option](_relatedTarget) + else if (options.show) data.show(_relatedTarget) + }) + } + + var old = $.fn.modal + + $.fn.modal = Plugin + $.fn.modal.Constructor = Modal + + + // MODAL NO CONFLICT + // ================= + + $.fn.modal.noConflict = function () { + $.fn.modal = old + return this + } + + + // MODAL DATA-API + // ============== + + $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { + var $this = $(this) + var href = $this.attr('href') + var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 + var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) + + if ($this.is('a')) e.preventDefault() + + $target.one('show.bs.modal', function (showEvent) { + if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown + $target.one('hidden.bs.modal', function () { + $this.is(':visible') && $this.trigger('focus') + }) + }) + Plugin.call($target, option, this) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: tooltip.js v3.3.7 + * http://getbootstrap.com/javascript/#tooltip + * Inspired by the original jQuery.tipsy by Jason Frame + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // TOOLTIP PUBLIC CLASS DEFINITION + // =============================== + + var Tooltip = function (element, options) { + this.type = null + this.options = null + this.enabled = null + this.timeout = null + this.hoverState = null + this.$element = null + this.inState = null + + this.init('tooltip', element, options) + } + + Tooltip.VERSION = '3.3.7' + + Tooltip.TRANSITION_DURATION = 150 + + Tooltip.DEFAULTS = { + animation: true, + placement: 'top', + selector: false, + template: '', + trigger: 'hover focus', + title: '', + delay: 0, + html: false, + container: false, + viewport: { + selector: 'body', + padding: 0 } - _clearInterval() { - if (this._interval) { - clearInterval(this._interval); - this._interval = null; - } + } + + Tooltip.prototype.init = function (type, element, options) { + this.enabled = true + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) + this.inState = { click: false, hover: false, focus: false } + + if (this.$element[0] instanceof document.constructor && !this.options.selector) { + throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') } - _directionToOrder(direction) { - if (isRTL()) { - return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; + + var triggers = this.options.trigger.split(' ') + + for (var i = triggers.length; i--;) { + var trigger = triggers[i] + + if (trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (trigger != 'manual') { + var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' + var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' + + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } - return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; } - _orderToDirection(order) { - if (isRTL()) { - return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + Tooltip.prototype.getDefaults = function () { + return Tooltip.DEFAULTS + } + + Tooltip.prototype.getOptions = function (options) { + options = $.extend({}, this.getDefaults(), this.$element.data(), options) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay, + hide: options.delay } - return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; } - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Carousel.getOrCreateInstance(this, config); - if (typeof config === 'number') { - data.to(config); - return; - } - if (typeof config === 'string') { - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - } - }); - } + return options } - /** - * Data API implementation - */ + Tooltip.prototype.getDelegateOptions = function () { + var options = {} + var defaults = this.getDefaults() - EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { - return; - } - event.preventDefault(); - const carousel = Carousel.getOrCreateInstance(target); - const slideIndex = this.getAttribute('data-bs-slide-to'); - if (slideIndex) { - carousel.to(slideIndex); - carousel._maybeEnableCycle(); - return; - } - if (Manipulator.getDataAttribute(this, 'slide') === 'next') { - carousel.next(); - carousel._maybeEnableCycle(); - return; - } - carousel.prev(); - carousel._maybeEnableCycle(); - }); - EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => { - const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); - for (const carousel of carousels) { - Carousel.getOrCreateInstance(carousel); + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }) + + return options + } + + Tooltip.prototype.enter = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) + + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) } - }); - - /** - * jQuery - */ - - defineJQueryPlugin(Carousel); - - /** - * -------------------------------------------------------------------------- - * Bootstrap collapse.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$b = 'collapse'; - const DATA_KEY$7 = 'bs.collapse'; - const EVENT_KEY$7 = `.${DATA_KEY$7}`; - const DATA_API_KEY$4 = '.data-api'; - const EVENT_SHOW$6 = `show${EVENT_KEY$7}`; - const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`; - const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`; - const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`; - const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; - const CLASS_NAME_SHOW$7 = 'show'; - const CLASS_NAME_COLLAPSE = 'collapse'; - const CLASS_NAME_COLLAPSING = 'collapsing'; - const CLASS_NAME_COLLAPSED = 'collapsed'; - const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; - const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; - const WIDTH = 'width'; - const HEIGHT = 'height'; - const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; - const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; - const Default$a = { - parent: null, - toggle: true - }; - const DefaultType$a = { - parent: '(null|element)', - toggle: 'boolean' - }; - - /** - * Class definition - */ - - class Collapse extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isTransitioning = false; - this._triggerArray = []; - const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); - for (const elem of toggleList) { - const selector = SelectorEngine.getSelectorFromElement(elem); - const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); - if (selector !== null && filterElement.length) { - this._triggerArray.push(elem); - } - } - this._initializeChildren(); - if (!this._config.parent) { - this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); - } - if (this._config.toggle) { - this.toggle(); - } + + if (obj instanceof $.Event) { + self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true } - // Getters - static get Default() { - return Default$a; + if (self.tip().hasClass('in') || self.hoverState == 'in') { + self.hoverState = 'in' + return } - static get DefaultType() { - return DefaultType$a; + + clearTimeout(self.timeout) + + self.hoverState = 'in' + + if (!self.options.delay || !self.options.delay.show) return self.show() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + Tooltip.prototype.isInStateTrue = function () { + for (var key in this.inState) { + if (this.inState[key]) return true } - static get NAME() { - return NAME$b; + + return false + } + + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget).data('bs.' + this.type) + + if (!self) { + self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) + $(obj.currentTarget).data('bs.' + this.type, self) } - // Public - toggle() { - if (this._isShown()) { - this.hide(); - } else { - this.show(); - } + if (obj instanceof $.Event) { + self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false } - show() { - if (this._isTransitioning || this._isShown()) { - return; - } - let activeChildren = []; - // find active children - if (this._config.parent) { - activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { - toggle: false - })); - } - if (activeChildren.length && activeChildren[0]._isTransitioning) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); - if (startEvent.defaultPrevented) { - return; + if (self.isInStateTrue()) return + + clearTimeout(self.timeout) + + self.hoverState = 'out' + + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.timeout = setTimeout(function () { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + Tooltip.prototype.show = function () { + var e = $.Event('show.bs.' + this.type) + + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) + + var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) + if (e.isDefaultPrevented() || !inDom) return + var that = this + + var $tip = this.tip() + + var tipId = this.getUID(this.type) + + this.setContent() + $tip.attr('id', tipId) + this.$element.attr('aria-describedby', tipId) + + if (this.options.animation) $tip.addClass('fade') + + var placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + var autoToken = /\s?auto?\s?/i + var autoPlace = autoToken.test(placement) + if (autoPlace) placement = placement.replace(autoToken, '') || 'top' + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }) + .addClass(placement) + .data('bs.' + this.type, this) + + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) + this.$element.trigger('inserted.bs.' + this.type) + + var pos = this.getPosition() + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (autoPlace) { + var orgPlacement = placement + var viewportDim = this.getPosition(this.$viewport) + + placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : + placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : + placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : + placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : + placement + + $tip + .removeClass(orgPlacement) + .addClass(placement) } - for (const activeInstance of activeChildren) { - activeInstance.hide(); + + var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) + + this.applyPlacement(calculatedOffset, placement) + + var complete = function () { + var prevHoverState = that.hoverState + that.$element.trigger('shown.bs.' + that.type) + that.hoverState = null + + if (prevHoverState == 'out') that.leave(that) } - const dimension = this._getDimension(); - this._element.classList.remove(CLASS_NAME_COLLAPSE); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.style[dimension] = 0; - this._addAriaAndCollapsedClass(this._triggerArray, true); - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - this._element.style[dimension] = ''; - EventHandler.trigger(this._element, EVENT_SHOWN$6); - }; - const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); - const scrollSize = `scroll${capitalizedDimension}`; - this._queueCallback(complete, this._element, true); - this._element.style[dimension] = `${this._element[scrollSize]}px`; + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : + complete() } - hide() { - if (this._isTransitioning || !this._isShown()) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); - if (startEvent.defaultPrevented) { - return; - } - const dimension = this._getDimension(); - this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; - reflow(this._element); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - for (const trigger of this._triggerArray) { - const element = SelectorEngine.getElementFromSelector(trigger); - if (element && !this._isShown(element)) { - this._addAriaAndCollapsedClass([trigger], false); - } + } + + Tooltip.prototype.applyPlacement = function (offset, placement) { + var $tip = this.tip() + var width = $tip[0].offsetWidth + var height = $tip[0].offsetHeight + + // manually read margins because getBoundingClientRect includes difference + var marginTop = parseInt($tip.css('margin-top'), 10) + var marginLeft = parseInt($tip.css('margin-left'), 10) + + // we must check for NaN for ie 8/9 + if (isNaN(marginTop)) marginTop = 0 + if (isNaN(marginLeft)) marginLeft = 0 + + offset.top += marginTop + offset.left += marginLeft + + // $.fn.offset doesn't round pixel values + // so we use setOffset directly with our own function B-0 + $.offset.setOffset($tip[0], $.extend({ + using: function (props) { + $tip.css({ + top: Math.round(props.top), + left: Math.round(props.left) + }) } - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE); - EventHandler.trigger(this._element, EVENT_HIDDEN$6); - }; - this._element.style[dimension] = ''; - this._queueCallback(complete, this._element, true); - } - _isShown(element = this._element) { - return element.classList.contains(CLASS_NAME_SHOW$7); - } + }, offset), 0) - // Private - _configAfterMerge(config) { - config.toggle = Boolean(config.toggle); // Coerce string values - config.parent = getElement(config.parent); - return config; - } - _getDimension() { - return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; + $tip.addClass('in') + + // check to see if placing tip in new offset caused the tip to resize itself + var actualWidth = $tip[0].offsetWidth + var actualHeight = $tip[0].offsetHeight + + if (placement == 'top' && actualHeight != height) { + offset.top = offset.top + height - actualHeight } - _initializeChildren() { - if (!this._config.parent) { - return; - } - const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); - for (const element of children) { - const selected = SelectorEngine.getElementFromSelector(element); - if (selected) { - this._addAriaAndCollapsedClass([element], this._isShown(selected)); - } + + var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) + + if (delta.left) offset.left += delta.left + else offset.top += delta.top + + var isVertical = /top|bottom/.test(placement) + var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight + var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' + + $tip.offset(offset) + this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) + } + + Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { + this.arrow() + .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') + .css(isVertical ? 'top' : 'left', '') + } + + Tooltip.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + Tooltip.prototype.hide = function (callback) { + var that = this + var $tip = $(this.$tip) + var e = $.Event('hide.bs.' + this.type) + + function complete() { + if (that.hoverState != 'in') $tip.detach() + if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. + that.$element + .removeAttr('aria-describedby') + .trigger('hidden.bs.' + that.type) } + callback && callback() } - _getFirstLevelChildren(selector) { - const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); - // remove children if greater depth - return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); - } - _addAriaAndCollapsedClass(triggerArray, isOpen) { - if (!triggerArray.length) { - return; - } - for (const element of triggerArray) { - element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); - element.setAttribute('aria-expanded', isOpen); - } + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + $tip.removeClass('in') + + $.support.transition && $tip.hasClass('fade') ? + $tip + .one('bsTransitionEnd', complete) + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : + complete() + + this.hoverState = null + + return this + } + + Tooltip.prototype.fixTitle = function () { + var $e = this.$element + if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') } + } + + Tooltip.prototype.hasContent = function () { + return this.getTitle() + } + + Tooltip.prototype.getPosition = function ($element) { + $element = $element || this.$element - // Static - static jQueryInterface(config) { - const _config = {}; - if (typeof config === 'string' && /show|hide/.test(config)) { - _config.toggle = false; - } - return this.each(function () { - const data = Collapse.getOrCreateInstance(this, _config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - } - }); + var el = $element[0] + var isBody = el.tagName == 'BODY' + + var elRect = el.getBoundingClientRect() + if (elRect.width == null) { + // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 + elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) } + var isSvg = window.SVGElement && el instanceof window.SVGElement + // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. + // See https://github.com/twbs/bootstrap/issues/20280 + var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) + var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } + var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null + + return $.extend({}, elRect, scroll, outerDims, elOffset) } - /** - * Data API implementation - */ + Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { + return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : + placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : + /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } - EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { - // preventDefault only for elements (which change the URL) not inside the collapsible element - if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { - event.preventDefault(); - } - for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) { - Collapse.getOrCreateInstance(element, { - toggle: false - }).toggle(); - } - }); - - /** - * jQuery - */ - - defineJQueryPlugin(Collapse); - - /** - * -------------------------------------------------------------------------- - * Bootstrap dropdown.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$a = 'dropdown'; - const DATA_KEY$6 = 'bs.dropdown'; - const EVENT_KEY$6 = `.${DATA_KEY$6}`; - const DATA_API_KEY$3 = '.data-api'; - const ESCAPE_KEY$2 = 'Escape'; - const TAB_KEY$1 = 'Tab'; - const ARROW_UP_KEY$1 = 'ArrowUp'; - const ARROW_DOWN_KEY$1 = 'ArrowDown'; - const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button - - const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`; - const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`; - const EVENT_SHOW$5 = `show${EVENT_KEY$6}`; - const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`; - const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; - const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`; - const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`; - const CLASS_NAME_SHOW$6 = 'show'; - const CLASS_NAME_DROPUP = 'dropup'; - const CLASS_NAME_DROPEND = 'dropend'; - const CLASS_NAME_DROPSTART = 'dropstart'; - const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; - const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; - const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; - const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`; - const SELECTOR_MENU = '.dropdown-menu'; - const SELECTOR_NAVBAR = '.navbar'; - const SELECTOR_NAVBAR_NAV = '.navbar-nav'; - const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; - const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; - const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; - const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; - const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; - const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; - const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; - const PLACEMENT_TOPCENTER = 'top'; - const PLACEMENT_BOTTOMCENTER = 'bottom'; - const Default$9 = { - autoClose: true, - boundary: 'clippingParents', - display: 'dynamic', - offset: [0, 2], - popperConfig: null, - reference: 'toggle' - }; - const DefaultType$9 = { - autoClose: '(boolean|string)', - boundary: '(string|element)', - display: 'string', - offset: '(array|string|function)', - popperConfig: '(null|object|function)', - reference: '(string|element|object)' - }; - - /** - * Class definition - */ - - class Dropdown extends BaseComponent { - constructor(element, config) { - super(element, config); - this._popper = null; - this._parent = this._element.parentNode; // dropdown wrapper - // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent); - this._inNavbar = this._detectNavbar(); - } + } - // Getters - static get Default() { - return Default$9; - } - static get DefaultType() { - return DefaultType$9; - } - static get NAME() { - return NAME$a; - } + Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { + var delta = { top: 0, left: 0 } + if (!this.$viewport) return delta - // Public - toggle() { - return this._isShown() ? this.hide() : this.show(); - } - show() { - if (isDisabled(this._element) || this._isShown()) { - return; - } - const relatedTarget = { - relatedTarget: this._element - }; - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); - if (showEvent.defaultPrevented) { - return; - } - this._createPopper(); - - // If this is a touch-enabled device we add extra - // empty mouseover listeners to the body's immediate children; - // only needed because of broken event delegation on iOS - // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); - } - } - this._element.focus(); - this._element.setAttribute('aria-expanded', true); - this._menu.classList.add(CLASS_NAME_SHOW$6); - this._element.classList.add(CLASS_NAME_SHOW$6); - EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); - } - hide() { - if (isDisabled(this._element) || !this._isShown()) { - return; - } - const relatedTarget = { - relatedTarget: this._element - }; - this._completeHide(relatedTarget); - } - dispose() { - if (this._popper) { - this._popper.destroy(); + var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 + var viewportDimensions = this.getPosition(this.$viewport) + + if (/right|left/.test(placement)) { + var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll + var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight + if (topEdgeOffset < viewportDimensions.top) { // top overflow + delta.top = viewportDimensions.top - topEdgeOffset + } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow + delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset } - super.dispose(); - } - update() { - this._inNavbar = this._detectNavbar(); - if (this._popper) { - this._popper.update(); + } else { + var leftEdgeOffset = pos.left - viewportPadding + var rightEdgeOffset = pos.left + viewportPadding + actualWidth + if (leftEdgeOffset < viewportDimensions.left) { // left overflow + delta.left = viewportDimensions.left - leftEdgeOffset + } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow + delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset } } - // Private - _completeHide(relatedTarget) { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); - if (hideEvent.defaultPrevented) { - return; - } + return delta + } - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); - } - } - if (this._popper) { - this._popper.destroy(); - } - this._menu.classList.remove(CLASS_NAME_SHOW$6); - this._element.classList.remove(CLASS_NAME_SHOW$6); - this._element.setAttribute('aria-expanded', 'false'); - Manipulator.removeDataAttribute(this._menu, 'popper'); - EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); - } - _getConfig(config) { - config = super._getConfig(config); - if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { - // Popper virtual elements require a getBoundingClientRect method - throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); - } - return config; - } - _createPopper() { - if (typeof Popper__namespace === 'undefined') { - throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); - } - let referenceElement = this._element; - if (this._config.reference === 'parent') { - referenceElement = this._parent; - } else if (isElement(this._config.reference)) { - referenceElement = getElement(this._config.reference); - } else if (typeof this._config.reference === 'object') { - referenceElement = this._config.reference; - } - const popperConfig = this._getPopperConfig(); - this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig); - } - _isShown() { - return this._menu.classList.contains(CLASS_NAME_SHOW$6); - } - _getPlacement() { - const parentDropdown = this._parent; - if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { - return PLACEMENT_RIGHT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { - return PLACEMENT_LEFT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { - return PLACEMENT_TOPCENTER; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { - return PLACEMENT_BOTTOMCENTER; - } + Tooltip.prototype.getTitle = function () { + var title + var $e = this.$element + var o = this.options - // We need to trim the value because custom properties can also include spaces - const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { - return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; - } - return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; - } - _detectNavbar() { - return this._element.closest(SELECTOR_NAVBAR) !== null; - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); - } - return offset; - } - _getPopperConfig() { - const defaultBsPopperConfig = { - placement: this._getPlacement(), - modifiers: [{ - name: 'preventOverflow', - options: { - boundary: this._config.boundary - } - }, { - name: 'offset', - options: { - offset: this._getOffset() - } - }] - }; - - // Disable Popper if we have a static display or Dropdown is in Navbar - if (this._inNavbar || this._config.display === 'static') { - Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove - defaultBsPopperConfig.modifiers = [{ - name: 'applyStyles', - enabled: false - }]; - } - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; - } - _selectMenuItem({ - key, - target - }) { - const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)); - if (!items.length) { - return; - } + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - // if target isn't included in items (e.g. when expanding the dropdown) - // allow cycling to get the last item in case key equals ARROW_UP_KEY - getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); - } + return title + } - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Dropdown.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } - static clearMenus(event) { - if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { - return; - } - const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); - for (const toggle of openToggles) { - const context = Dropdown.getInstance(toggle); - if (!context || context._config.autoClose === false) { - continue; - } - const composedPath = event.composedPath(); - const isMenuTarget = composedPath.includes(context._menu); - if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { - continue; - } + Tooltip.prototype.getUID = function (prefix) { + do prefix += ~~(Math.random() * 1000000) + while (document.getElementById(prefix)) + return prefix + } - // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu - if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { - continue; - } - const relatedTarget = { - relatedTarget: context._element - }; - if (event.type === 'click') { - relatedTarget.clickEvent = event; - } - context._completeHide(relatedTarget); - } - } - static dataApiKeydownHandler(event) { - // If not an UP | DOWN | ESCAPE key => not a dropdown command - // If input/textarea && if key is other than ESCAPE => not a dropdown command - - const isInput = /input|textarea/i.test(event.target.tagName); - const isEscapeEvent = event.key === ESCAPE_KEY$2; - const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); - if (!isUpOrDownEvent && !isEscapeEvent) { - return; - } - if (isInput && !isEscapeEvent) { - return; - } - event.preventDefault(); - - // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); - const instance = Dropdown.getOrCreateInstance(getToggleButton); - if (isUpOrDownEvent) { - event.stopPropagation(); - instance.show(); - instance._selectMenuItem(event); - return; - } - if (instance._isShown()) { - // else is escape and we check if it is shown - event.stopPropagation(); - instance.hide(); - getToggleButton.focus(); + Tooltip.prototype.tip = function () { + if (!this.$tip) { + this.$tip = $(this.options.template) + if (this.$tip.length != 1) { + throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') } } + return this.$tip } - /** - * Data API implementation - */ - - EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); - EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); - EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); - EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); - EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { - event.preventDefault(); - Dropdown.getOrCreateInstance(this).toggle(); - }); - - /** - * jQuery - */ - - defineJQueryPlugin(Dropdown); - - /** - * -------------------------------------------------------------------------- - * Bootstrap util/backdrop.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$9 = 'backdrop'; - const CLASS_NAME_FADE$4 = 'fade'; - const CLASS_NAME_SHOW$5 = 'show'; - const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`; - const Default$8 = { - className: 'modal-backdrop', - clickCallback: null, - isAnimated: false, - isVisible: true, - // if false, we use the backdrop helper without adding any element to the dom - rootElement: 'body' // give the choice to place backdrop under different elements - }; - const DefaultType$8 = { - className: 'string', - clickCallback: '(function|null)', - isAnimated: 'boolean', - isVisible: 'boolean', - rootElement: '(element|string)' - }; - - /** - * Class definition - */ - - class Backdrop extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isAppended = false; - this._element = null; - } + Tooltip.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) + } - // Getters - static get Default() { - return Default$8; - } - static get DefaultType() { - return DefaultType$8; - } - static get NAME() { - return NAME$9; - } + Tooltip.prototype.enable = function () { + this.enabled = true + } - // Public - show(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._append(); - const element = this._getElement(); - if (this._config.isAnimated) { - reflow(element); - } - element.classList.add(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - execute(callback); - }); - } - hide(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._getElement().classList.remove(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - this.dispose(); - execute(callback); - }); - } - dispose() { - if (!this._isAppended) { - return; - } - EventHandler.off(this._element, EVENT_MOUSEDOWN); - this._element.remove(); - this._isAppended = false; - } + Tooltip.prototype.disable = function () { + this.enabled = false + } - // Private - _getElement() { - if (!this._element) { - const backdrop = document.createElement('div'); - backdrop.className = this._config.className; - if (this._config.isAnimated) { - backdrop.classList.add(CLASS_NAME_FADE$4); - } - this._element = backdrop; - } - return this._element; - } - _configAfterMerge(config) { - // use getElement() with the default "body" to get a fresh Element on each instantiation - config.rootElement = getElement(config.rootElement); - return config; - } - _append() { - if (this._isAppended) { - return; + Tooltip.prototype.toggleEnabled = function () { + this.enabled = !this.enabled + } + + Tooltip.prototype.toggle = function (e) { + var self = this + if (e) { + self = $(e.currentTarget).data('bs.' + this.type) + if (!self) { + self = new this.constructor(e.currentTarget, this.getDelegateOptions()) + $(e.currentTarget).data('bs.' + this.type, self) } - const element = this._getElement(); - this._config.rootElement.append(element); - EventHandler.on(element, EVENT_MOUSEDOWN, () => { - execute(this._config.clickCallback); - }); - this._isAppended = true; } - _emulateAnimation(callback) { - executeAfterTransition(callback, this._getElement(), this._config.isAnimated); + + if (e) { + self.inState.click = !self.inState.click + if (self.isInStateTrue()) self.enter(self) + else self.leave(self) + } else { + self.tip().hasClass('in') ? self.leave(self) : self.enter(self) } } - /** - * -------------------------------------------------------------------------- - * Bootstrap util/focustrap.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$8 = 'focustrap'; - const DATA_KEY$5 = 'bs.focustrap'; - const EVENT_KEY$5 = `.${DATA_KEY$5}`; - const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`; - const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`; - const TAB_KEY = 'Tab'; - const TAB_NAV_FORWARD = 'forward'; - const TAB_NAV_BACKWARD = 'backward'; - const Default$7 = { - autofocus: true, - trapElement: null // The element to trap focus inside of - }; - const DefaultType$7 = { - autofocus: 'boolean', - trapElement: 'element' - }; - - /** - * Class definition - */ - - class FocusTrap extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isActive = false; - this._lastTabNavDirection = null; - } + Tooltip.prototype.destroy = function () { + var that = this + clearTimeout(this.timeout) + this.hide(function () { + that.$element.off('.' + that.type).removeData('bs.' + that.type) + if (that.$tip) { + that.$tip.detach() + } + that.$tip = null + that.$arrow = null + that.$viewport = null + that.$element = null + }) + } - // Getters - static get Default() { - return Default$7; - } - static get DefaultType() { - return DefaultType$7; - } - static get NAME() { - return NAME$8; - } - // Public - activate() { - if (this._isActive) { - return; - } - if (this._config.autofocus) { - this._config.trapElement.focus(); - } - EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop - EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event)); - EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); - this._isActive = true; - } - deactivate() { - if (!this._isActive) { - return; - } - this._isActive = false; - EventHandler.off(document, EVENT_KEY$5); - } + // TOOLTIP PLUGIN DEFINITION + // ========================= - // Private - _handleFocusin(event) { - const { - trapElement - } = this._config; - if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { - return; - } - const elements = SelectorEngine.focusableChildren(trapElement); - if (elements.length === 0) { - trapElement.focus(); - } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { - elements[elements.length - 1].focus(); - } else { - elements[0].focus(); - } - } - _handleKeydown(event) { - if (event.key !== TAB_KEY) { - return; - } - this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; - } + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tooltip') + var options = typeof option == 'object' && option + + if (!data && /destroy|hide/.test(option)) return + if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) } - /** - * -------------------------------------------------------------------------- - * Bootstrap util/scrollBar.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + var old = $.fn.tooltip + $.fn.tooltip = Plugin + $.fn.tooltip.Constructor = Tooltip - /** - * Constants - */ - const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; - const SELECTOR_STICKY_CONTENT = '.sticky-top'; - const PROPERTY_PADDING = 'padding-right'; - const PROPERTY_MARGIN = 'margin-right'; + // TOOLTIP NO CONFLICT + // =================== - /** - * Class definition - */ + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } - class ScrollBarHelper { - constructor() { - this._element = document.body; - } +}(jQuery); - // Public - getWidth() { - // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes - const documentWidth = document.documentElement.clientWidth; - return Math.abs(window.innerWidth - documentWidth); - } - hide() { - const width = this.getWidth(); - this._disableOverFlow(); - // give padding to element to balance the hidden scrollbar width - this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth - this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); - } - reset() { - this._resetElementAttributes(this._element, 'overflow'); - this._resetElementAttributes(this._element, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); - } - isOverflowing() { - return this.getWidth() > 0; - } +/* ======================================================================== + * Bootstrap: popover.js v3.3.7 + * http://getbootstrap.com/javascript/#popovers + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - // Private - _disableOverFlow() { - this._saveInitialAttribute(this._element, 'overflow'); - this._element.style.overflow = 'hidden'; - } - _setElementAttributes(selector, styleProperty, callback) { - const scrollbarWidth = this.getWidth(); - const manipulationCallBack = element => { - if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { - return; - } - this._saveInitialAttribute(element, styleProperty); - const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); - element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _saveInitialAttribute(element, styleProperty) { - const actualValue = element.style.getPropertyValue(styleProperty); - if (actualValue) { - Manipulator.setDataAttribute(element, styleProperty, actualValue); - } - } - _resetElementAttributes(selector, styleProperty) { - const manipulationCallBack = element => { - const value = Manipulator.getDataAttribute(element, styleProperty); - // We only want to remove the property if the value is `null`; the value can also be zero - if (value === null) { - element.style.removeProperty(styleProperty); - return; - } - Manipulator.removeDataAttribute(element, styleProperty); - element.style.setProperty(styleProperty, value); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _applyManipulationCallback(selector, callBack) { - if (isElement(selector)) { - callBack(selector); - return; - } - for (const sel of SelectorEngine.find(selector, this._element)) { - callBack(sel); - } - } + ++function ($) { + 'use strict'; + + // POPOVER PUBLIC CLASS DEFINITION + // =============================== + + var Popover = function (element, options) { + this.init('popover', element, options) } - /** - * -------------------------------------------------------------------------- - * Bootstrap modal.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$7 = 'modal'; - const DATA_KEY$4 = 'bs.modal'; - const EVENT_KEY$4 = `.${DATA_KEY$4}`; - const DATA_API_KEY$2 = '.data-api'; - const ESCAPE_KEY$1 = 'Escape'; - const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`; - const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`; - const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`; - const EVENT_SHOW$4 = `show${EVENT_KEY$4}`; - const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`; - const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`; - const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`; - const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`; - const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`; - const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`; - const CLASS_NAME_OPEN = 'modal-open'; - const CLASS_NAME_FADE$3 = 'fade'; - const CLASS_NAME_SHOW$4 = 'show'; - const CLASS_NAME_STATIC = 'modal-static'; - const OPEN_SELECTOR$1 = '.modal.show'; - const SELECTOR_DIALOG = '.modal-dialog'; - const SELECTOR_MODAL_BODY = '.modal-body'; - const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; - const Default$6 = { - backdrop: true, - focus: true, - keyboard: true - }; - const DefaultType$6 = { - backdrop: '(boolean|string)', - focus: 'boolean', - keyboard: 'boolean' - }; - - /** - * Class definition - */ - - class Modal extends BaseComponent { - constructor(element, config) { - super(element, config); - this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._isShown = false; - this._isTransitioning = false; - this._scrollBar = new ScrollBarHelper(); - this._addEventListeners(); - } + if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') - // Getters - static get Default() { - return Default$6; - } - static get DefaultType() { - return DefaultType$6; - } - static get NAME() { - return NAME$7; - } + Popover.VERSION = '3.3.7' - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - show(relatedTarget) { - if (this._isShown || this._isTransitioning) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._isTransitioning = true; - this._scrollBar.hide(); - document.body.classList.add(CLASS_NAME_OPEN); - this._adjustDialog(); - this._backdrop.show(() => this._showElement(relatedTarget)); - } - hide() { - if (!this._isShown || this._isTransitioning) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); - if (hideEvent.defaultPrevented) { - return; - } - this._isShown = false; - this._isTransitioning = true; - this._focustrap.deactivate(); - this._element.classList.remove(CLASS_NAME_SHOW$4); - this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); - } - dispose() { - EventHandler.off(window, EVENT_KEY$4); - EventHandler.off(this._dialog, EVENT_KEY$4); - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - handleUpdate() { - this._adjustDialog(); - } + Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { + placement: 'right', + trigger: 'click', + content: '', + template: '' + }) - // Private - _initializeBackDrop() { - return new Backdrop({ - isVisible: Boolean(this._config.backdrop), - // 'static' option will be translated to true, and booleans will keep their value, - isAnimated: this._isAnimated() - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _showElement(relatedTarget) { - // try to append dynamic modal - if (!document.body.contains(this._element)) { - document.body.append(this._element); - } - this._element.style.display = 'block'; - this._element.removeAttribute('aria-hidden'); - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.scrollTop = 0; - const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); - if (modalBody) { - modalBody.scrollTop = 0; - } - reflow(this._element); - this._element.classList.add(CLASS_NAME_SHOW$4); - const transitionComplete = () => { - if (this._config.focus) { - this._focustrap.activate(); - } - this._isTransitioning = false; - EventHandler.trigger(this._element, EVENT_SHOWN$4, { - relatedTarget - }); - }; - this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { - if (event.key !== ESCAPE_KEY$1) { - return; - } - if (this._config.keyboard) { - this.hide(); - return; - } - this._triggerBackdropTransition(); - }); - EventHandler.on(window, EVENT_RESIZE$1, () => { - if (this._isShown && !this._isTransitioning) { - this._adjustDialog(); - } - }); - EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { - // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks - EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => { - if (this._element !== event.target || this._element !== event2.target) { - return; - } - if (this._config.backdrop === 'static') { - this._triggerBackdropTransition(); - return; - } - if (this._config.backdrop) { - this.hide(); - } - }); - }); - } - _hideModal() { - this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', true); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - this._isTransitioning = false; - this._backdrop.hide(() => { - document.body.classList.remove(CLASS_NAME_OPEN); - this._resetAdjustments(); - this._scrollBar.reset(); - EventHandler.trigger(this._element, EVENT_HIDDEN$4); - }); - } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_FADE$3); - } - _triggerBackdropTransition() { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); - if (hideEvent.defaultPrevented) { - return; - } - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const initialOverflowY = this._element.style.overflowY; - // return if the following background transition hasn't yet completed - if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { - return; - } - if (!isModalOverflowing) { - this._element.style.overflowY = 'hidden'; - } - this._element.classList.add(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.classList.remove(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.style.overflowY = initialOverflowY; - }, this._dialog); - }, this._dialog); - this._element.focus(); - } - /** - * The following methods are used to handle overflowing modals - */ - - _adjustDialog() { - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const scrollbarWidth = this._scrollBar.getWidth(); - const isBodyOverflowing = scrollbarWidth > 0; - if (isBodyOverflowing && !isModalOverflowing) { - const property = isRTL() ? 'paddingLeft' : 'paddingRight'; - this._element.style[property] = `${scrollbarWidth}px`; - } - if (!isBodyOverflowing && isModalOverflowing) { - const property = isRTL() ? 'paddingRight' : 'paddingLeft'; - this._element.style[property] = `${scrollbarWidth}px`; - } - } - _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; - } + // NOTE: POPOVER EXTENDS tooltip.js + // ================================ - // Static - static jQueryInterface(config, relatedTarget) { - return this.each(function () { - const data = Modal.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](relatedTarget); - }); - } + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) + + Popover.prototype.constructor = Popover + + Popover.prototype.getDefaults = function () { + return Popover.DEFAULTS } - /** - * Data API implementation - */ + Popover.prototype.setContent = function () { + var $tip = this.tip() + var title = this.getTitle() + var content = this.getContent() - EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } - EventHandler.one(target, EVENT_SHOW$4, showEvent => { - if (showEvent.defaultPrevented) { - // only register focus restorer if modal will actually get shown - return; - } - EventHandler.one(target, EVENT_HIDDEN$4, () => { - if (isVisible(this)) { - this.focus(); - } - }); - }); + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) + $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events + this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' + ](content) - // avoid conflict when clicking modal toggler while another one is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); - if (alreadyOpen) { - Modal.getInstance(alreadyOpen).hide(); - } - const data = Modal.getOrCreateInstance(target); - data.toggle(this); - }); - enableDismissTrigger(Modal); - - /** - * jQuery - */ - - defineJQueryPlugin(Modal); - - /** - * -------------------------------------------------------------------------- - * Bootstrap offcanvas.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$6 = 'offcanvas'; - const DATA_KEY$3 = 'bs.offcanvas'; - const EVENT_KEY$3 = `.${DATA_KEY$3}`; - const DATA_API_KEY$1 = '.data-api'; - const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`; - const ESCAPE_KEY = 'Escape'; - const CLASS_NAME_SHOW$3 = 'show'; - const CLASS_NAME_SHOWING$1 = 'showing'; - const CLASS_NAME_HIDING = 'hiding'; - const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; - const OPEN_SELECTOR = '.offcanvas.show'; - const EVENT_SHOW$3 = `show${EVENT_KEY$3}`; - const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`; - const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`; - const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`; - const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`; - const EVENT_RESIZE = `resize${EVENT_KEY$3}`; - const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`; - const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`; - const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; - const Default$5 = { - backdrop: true, - keyboard: true, - scroll: false - }; - const DefaultType$5 = { - backdrop: '(boolean|string)', - keyboard: 'boolean', - scroll: 'boolean' - }; - - /** - * Class definition - */ - - class Offcanvas extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isShown = false; - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._addEventListeners(); - } + $tip.removeClass('fade top bottom left right in') - // Getters - static get Default() { - return Default$5; - } - static get DefaultType() { - return DefaultType$5; - } - static get NAME() { - return NAME$6; - } + // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do + // this manually by checking the contents. + if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() + } - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - show(relatedTarget) { - if (this._isShown) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._backdrop.show(); - if (!this._config.scroll) { - new ScrollBarHelper().hide(); - } - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.classList.add(CLASS_NAME_SHOWING$1); - const completeCallBack = () => { - if (!this._config.scroll || this._config.backdrop) { - this._focustrap.activate(); - } - this._element.classList.add(CLASS_NAME_SHOW$3); - this._element.classList.remove(CLASS_NAME_SHOWING$1); - EventHandler.trigger(this._element, EVENT_SHOWN$3, { - relatedTarget - }); - }; - this._queueCallback(completeCallBack, this._element, true); - } - hide() { - if (!this._isShown) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); - if (hideEvent.defaultPrevented) { - return; - } - this._focustrap.deactivate(); - this._element.blur(); - this._isShown = false; - this._element.classList.add(CLASS_NAME_HIDING); - this._backdrop.hide(); - const completeCallback = () => { - this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - if (!this._config.scroll) { - new ScrollBarHelper().reset(); - } - EventHandler.trigger(this._element, EVENT_HIDDEN$3); - }; - this._queueCallback(completeCallback, this._element, true); - } - dispose() { - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } + Popover.prototype.hasContent = function () { + return this.getTitle() || this.getContent() + } - // Private - _initializeBackDrop() { - const clickCallback = () => { - if (this._config.backdrop === 'static') { - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); - return; - } - this.hide(); - }; - - // 'static' option will be translated to true, and booleans will keep their value - const isVisible = Boolean(this._config.backdrop); - return new Backdrop({ - className: CLASS_NAME_BACKDROP, - isVisible, - isAnimated: true, - rootElement: this._element.parentNode, - clickCallback: isVisible ? clickCallback : null - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { - if (event.key !== ESCAPE_KEY) { - return; - } - if (this._config.keyboard) { - this.hide(); - return; - } - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); - }); - } + Popover.prototype.getContent = function () { + var $e = this.$element + var o = this.options - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Offcanvas.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); - }); - } + return $e.attr('data-content') + || (typeof o.content == 'function' ? + o.content.call($e[0]) : + o.content) } - /** - * Data API implementation - */ + Popover.prototype.arrow = function () { + return (this.$arrow = this.$arrow || this.tip().find('.arrow')) + } - EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } - if (isDisabled(this)) { - return; - } - EventHandler.one(target, EVENT_HIDDEN$3, () => { - // focus on trigger when it is closed - if (isVisible(this)) { - this.focus(); - } - }); - // avoid conflict when clicking a toggler of an offcanvas, while another is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); - if (alreadyOpen && alreadyOpen !== target) { - Offcanvas.getInstance(alreadyOpen).hide(); - } - const data = Offcanvas.getOrCreateInstance(target); - data.toggle(this); - }); - EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { - for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { - Offcanvas.getOrCreateInstance(selector).show(); - } - }); - EventHandler.on(window, EVENT_RESIZE, () => { - for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { - if (getComputedStyle(element).position !== 'fixed') { - Offcanvas.getOrCreateInstance(element).hide(); - } + // POPOVER PLUGIN DEFINITION + // ========================= + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.popover') + var options = typeof option == 'object' && option + + if (!data && /destroy|hide/.test(option)) return + if (!data) $this.data('bs.popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.popover + + $.fn.popover = Plugin + $.fn.popover.Constructor = Popover + + + // POPOVER NO CONFLICT + // =================== + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(jQuery); + +/* ======================================================================== + * Bootstrap: scrollspy.js v3.3.7 + * http://getbootstrap.com/javascript/#scrollspy + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // SCROLLSPY CLASS DEFINITION + // ========================== + + function ScrollSpy(element, options) { + this.$body = $(document.body) + this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) + this.options = $.extend({}, ScrollSpy.DEFAULTS, options) + this.selector = (this.options.target || '') + ' .nav li > a' + this.offsets = [] + this.targets = [] + this.activeTarget = null + this.scrollHeight = 0 + + this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) + this.refresh() + this.process() + } + + ScrollSpy.VERSION = '3.3.7' + + ScrollSpy.DEFAULTS = { + offset: 10 + } + + ScrollSpy.prototype.getScrollHeight = function () { + return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) + } + + ScrollSpy.prototype.refresh = function () { + var that = this + var offsetMethod = 'offset' + var offsetBase = 0 + + this.offsets = [] + this.targets = [] + this.scrollHeight = this.getScrollHeight() + + if (!$.isWindow(this.$scrollElement[0])) { + offsetMethod = 'position' + offsetBase = this.$scrollElement.scrollTop() + } + + this.$body + .find(this.selector) + .map(function () { + var $el = $(this) + var href = $el.data('target') || $el.attr('href') + var $href = /^#./.test(href) && $(href) + + return ($href + && $href.length + && $href.is(':visible') + && [[$href[offsetMethod]().top + offsetBase, href]]) || null + }) + .sort(function (a, b) { return a[0] - b[0] }) + .each(function () { + that.offsets.push(this[0]) + that.targets.push(this[1]) + }) + } + + ScrollSpy.prototype.process = function () { + var scrollTop = this.$scrollElement.scrollTop() + this.options.offset + var scrollHeight = this.getScrollHeight() + var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() + var offsets = this.offsets + var targets = this.targets + var activeTarget = this.activeTarget + var i + + if (this.scrollHeight != scrollHeight) { + this.refresh() } - }); - enableDismissTrigger(Offcanvas); - - /** - * jQuery - */ - - defineJQueryPlugin(Offcanvas); - - /** - * -------------------------------------------------------------------------- - * Bootstrap util/sanitizer.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - // js-docs-start allow-list - const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; - const DefaultAllowlist = { - // Global attributes allowed on any supplied element below. - '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], - a: ['target', 'href', 'title', 'rel'], - area: [], - b: [], - br: [], - col: [], - code: [], - dd: [], - div: [], - dl: [], - dt: [], - em: [], - hr: [], - h1: [], - h2: [], - h3: [], - h4: [], - h5: [], - h6: [], - i: [], - img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], - li: [], - ol: [], - p: [], - pre: [], - s: [], - small: [], - span: [], - sub: [], - sup: [], - strong: [], - u: [], - ul: [] - }; - // js-docs-end allow-list - - const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); - - /** - * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation - * contexts. - * - * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 - */ - // eslint-disable-next-line unicorn/better-regex - const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; - const allowedAttribute = (attribute, allowedAttributeList) => { - const attributeName = attribute.nodeName.toLowerCase(); - if (allowedAttributeList.includes(attributeName)) { - if (uriAttributes.has(attributeName)) { - return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); - } - return true; + + if (scrollTop >= maxScroll) { + return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) } - // Check if a regular expression validates the attribute. - return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); - }; - function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { - if (!unsafeHtml.length) { - return unsafeHtml; + if (activeTarget && scrollTop < offsets[0]) { + this.activeTarget = null + return this.clear() } - if (sanitizeFunction && typeof sanitizeFunction === 'function') { - return sanitizeFunction(unsafeHtml); + + for (i = offsets.length; i--;) { + activeTarget != targets[i] + && scrollTop >= offsets[i] + && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) + && this.activate(targets[i]) } - const domParser = new window.DOMParser(); - const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); - const elements = [].concat(...createdDocument.body.querySelectorAll('*')); - for (const element of elements) { - const elementName = element.nodeName.toLowerCase(); - if (!Object.keys(allowList).includes(elementName)) { - element.remove(); - continue; - } - const attributeList = [].concat(...element.attributes); - const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); - for (const attribute of attributeList) { - if (!allowedAttribute(attribute, allowedAttributes)) { - element.removeAttribute(attribute.nodeName); - } - } + } + + ScrollSpy.prototype.activate = function (target) { + this.activeTarget = target + + this.clear() + + var selector = this.selector + + '[data-target="' + target + '"],' + + this.selector + '[href="' + target + '"]' + + var active = $(selector) + .parents('li') + .addClass('active') + + if (active.parent('.dropdown-menu').length) { + active = active + .closest('li.dropdown') + .addClass('active') } - return createdDocument.body.innerHTML; + + active.trigger('activate.bs.scrollspy') + } + + ScrollSpy.prototype.clear = function () { + $(this.selector) + .parentsUntil(this.options.target, '.active') + .removeClass('active') + } + + + // SCROLLSPY PLUGIN DEFINITION + // =========================== + + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.scrollspy') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + var old = $.fn.scrollspy + + $.fn.scrollspy = Plugin + $.fn.scrollspy.Constructor = ScrollSpy + + + // SCROLLSPY NO CONFLICT + // ===================== + + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this } - /** - * -------------------------------------------------------------------------- - * Bootstrap util/template-factory.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + // SCROLLSPY DATA-API + // ================== - /** - * Constants - */ + $(window).on('load.bs.scrollspy.data-api', function () { + $('[data-spy="scroll"]').each(function () { + var $spy = $(this) + Plugin.call($spy, $spy.data()) + }) + }) - const NAME$5 = 'TemplateFactory'; - const Default$4 = { - allowList: DefaultAllowlist, - content: {}, - // { selector : text , selector2 : text2 , } - extraClass: '', - html: false, - sanitize: true, - sanitizeFn: null, - template: '' - }; - const DefaultType$4 = { - allowList: 'object', - content: 'object', - extraClass: '(string|function)', - html: 'boolean', - sanitize: 'boolean', - sanitizeFn: '(null|function)', - template: 'string' - }; - const DefaultContentType = { - entry: '(string|element|function|null)', - selector: '(string|element)' - }; - - /** - * Class definition - */ - - class TemplateFactory extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - } +}(jQuery); - // Getters - static get Default() { - return Default$4; - } - static get DefaultType() { - return DefaultType$4; - } - static get NAME() { - return NAME$5; - } +/* ======================================================================== + * Bootstrap: tab.js v3.3.7 + * http://getbootstrap.com/javascript/#tabs + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - // Public - getContent() { - return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); - } - hasContent() { - return this.getContent().length > 0; - } - changeContent(content) { - this._checkContent(content); - this._config.content = { - ...this._config.content, - ...content - }; - return this; - } - toHtml() { - const templateWrapper = document.createElement('div'); - templateWrapper.innerHTML = this._maybeSanitize(this._config.template); - for (const [selector, text] of Object.entries(this._config.content)) { - this._setContent(templateWrapper, text, selector); - } - const template = templateWrapper.children[0]; - const extraClass = this._resolvePossibleFunction(this._config.extraClass); - if (extraClass) { - template.classList.add(...extraClass.split(' ')); - } - return template; - } - // Private - _typeCheckConfig(config) { - super._typeCheckConfig(config); - this._checkContent(config.content); - } - _checkContent(arg) { - for (const [selector, content] of Object.entries(arg)) { - super._typeCheckConfig({ - selector, - entry: content - }, DefaultContentType); - } - } - _setContent(template, content, selector) { - const templateElement = SelectorEngine.findOne(selector, template); - if (!templateElement) { - return; - } - content = this._resolvePossibleFunction(content); - if (!content) { - templateElement.remove(); - return; - } - if (isElement(content)) { - this._putElementInTemplate(getElement(content), templateElement); - return; - } - if (this._config.html) { - templateElement.innerHTML = this._maybeSanitize(content); - return; - } - templateElement.textContent = content; - } - _maybeSanitize(arg) { - return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this]); - } - _putElementInTemplate(element, templateElement) { - if (this._config.html) { - templateElement.innerHTML = ''; - templateElement.append(element); - return; - } - templateElement.textContent = element.textContent; - } ++function ($) { + 'use strict'; + + // TAB CLASS DEFINITION + // ==================== + + var Tab = function (element) { + // jscs:disable requireDollarBeforejQueryAssignment + this.element = $(element) + // jscs:enable requireDollarBeforejQueryAssignment } - /** - * -------------------------------------------------------------------------- - * Bootstrap tooltip.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$4 = 'tooltip'; - const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); - const CLASS_NAME_FADE$2 = 'fade'; - const CLASS_NAME_MODAL = 'modal'; - const CLASS_NAME_SHOW$2 = 'show'; - const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; - const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; - const EVENT_MODAL_HIDE = 'hide.bs.modal'; - const TRIGGER_HOVER = 'hover'; - const TRIGGER_FOCUS = 'focus'; - const TRIGGER_CLICK = 'click'; - const TRIGGER_MANUAL = 'manual'; - const EVENT_HIDE$2 = 'hide'; - const EVENT_HIDDEN$2 = 'hidden'; - const EVENT_SHOW$2 = 'show'; - const EVENT_SHOWN$2 = 'shown'; - const EVENT_INSERTED = 'inserted'; - const EVENT_CLICK$1 = 'click'; - const EVENT_FOCUSIN$1 = 'focusin'; - const EVENT_FOCUSOUT$1 = 'focusout'; - const EVENT_MOUSEENTER = 'mouseenter'; - const EVENT_MOUSELEAVE = 'mouseleave'; - const AttachmentMap = { - AUTO: 'auto', - TOP: 'top', - RIGHT: isRTL() ? 'left' : 'right', - BOTTOM: 'bottom', - LEFT: isRTL() ? 'right' : 'left' - }; - const Default$3 = { - allowList: DefaultAllowlist, - animation: true, - boundary: 'clippingParents', - container: false, - customClass: '', - delay: 0, - fallbackPlacements: ['top', 'right', 'bottom', 'left'], - html: false, - offset: [0, 6], - placement: 'top', - popperConfig: null, - sanitize: true, - sanitizeFn: null, - selector: false, - template: '' + '' + '' + '', - title: '', - trigger: 'hover focus' - }; - const DefaultType$3 = { - allowList: 'object', - animation: 'boolean', - boundary: '(string|element)', - container: '(string|element|boolean)', - customClass: '(string|function)', - delay: '(number|object)', - fallbackPlacements: 'array', - html: 'boolean', - offset: '(array|string|function)', - placement: '(string|function)', - popperConfig: '(null|object|function)', - sanitize: 'boolean', - sanitizeFn: '(null|function)', - selector: '(string|boolean)', - template: 'string', - title: '(string|element|function)', - trigger: 'string' - }; - - /** - * Class definition - */ - - class Tooltip extends BaseComponent { - constructor(element, config) { - if (typeof Popper__namespace === 'undefined') { - throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); - } - super(element, config); - - // Private - this._isEnabled = true; - this._timeout = 0; - this._isHovered = null; - this._activeTrigger = {}; - this._popper = null; - this._templateFactory = null; - this._newContent = null; - - // Protected - this.tip = null; - this._setListeners(); - if (!this._config.selector) { - this._fixTitle(); - } - } + Tab.VERSION = '3.3.7' - // Getters - static get Default() { - return Default$3; - } - static get DefaultType() { - return DefaultType$3; - } - static get NAME() { - return NAME$4; - } + Tab.TRANSITION_DURATION = 150 - // Public - enable() { - this._isEnabled = true; - } - disable() { - this._isEnabled = false; - } - toggleEnabled() { - this._isEnabled = !this._isEnabled; - } - toggle() { - if (!this._isEnabled) { - return; - } - this._activeTrigger.click = !this._activeTrigger.click; - if (this._isShown()) { - this._leave(); - return; - } - this._enter(); - } - dispose() { - clearTimeout(this._timeout); - EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - if (this._element.getAttribute('data-bs-original-title')) { - this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); - } - this._disposePopper(); - super.dispose(); - } - show() { - if (this._element.style.display === 'none') { - throw new Error('Please use show on visible elements'); - } - if (!(this._isWithContent() && this._isEnabled)) { - return; - } - const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); - const shadowRoot = findShadowRoot(this._element); - const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); - if (showEvent.defaultPrevented || !isInTheDom) { - return; - } + Tab.prototype.show = function () { + var $this = this.element + var $ul = $this.closest('ul:not(.dropdown-menu)') + var selector = $this.data('target') - // TODO: v6 remove this or make it optional - this._disposePopper(); - const tip = this._getTipElement(); - this._element.setAttribute('aria-describedby', tip.getAttribute('id')); - const { - container - } = this._config; - if (!this._element.ownerDocument.documentElement.contains(this.tip)) { - container.append(tip); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); - } - this._popper = this._createPopper(tip); - tip.classList.add(CLASS_NAME_SHOW$2); - - // If this is a touch-enabled device we add extra - // empty mouseover listeners to the body's immediate children; - // only needed because of broken event delegation on iOS - // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); - } - } - const complete = () => { - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2)); - if (this._isHovered === false) { - this._leave(); - } - this._isHovered = false; - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - hide() { - if (!this._isShown()) { - return; - } - const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); - if (hideEvent.defaultPrevented) { - return; - } - const tip = this._getTipElement(); - tip.classList.remove(CLASS_NAME_SHOW$2); - - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); - } - } - this._activeTrigger[TRIGGER_CLICK] = false; - this._activeTrigger[TRIGGER_FOCUS] = false; - this._activeTrigger[TRIGGER_HOVER] = false; - this._isHovered = null; // it is a trick to support manual triggering - - const complete = () => { - if (this._isWithActiveTrigger()) { - return; - } - if (!this._isHovered) { - this._disposePopper(); - } - this._element.removeAttribute('aria-describedby'); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2)); - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - update() { - if (this._popper) { - this._popper.update(); - } + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - // Protected - _isWithContent() { - return Boolean(this._getTitle()); - } - _getTipElement() { - if (!this.tip) { - this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); - } - return this.tip; - } - _createTipElement(content) { - const tip = this._getTemplateFactory(content).toHtml(); + if ($this.parent('li').hasClass('active')) return - // TODO: remove this check in v6 - if (!tip) { - return null; - } - tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); - // TODO: v6 the following can be achieved with CSS only - tip.classList.add(`bs-${this.constructor.NAME}-auto`); - const tipId = getUID(this.constructor.NAME).toString(); - tip.setAttribute('id', tipId); - if (this._isAnimated()) { - tip.classList.add(CLASS_NAME_FADE$2); - } - return tip; - } - setContent(content) { - this._newContent = content; - if (this._isShown()) { - this._disposePopper(); - this.show(); - } - } - _getTemplateFactory(content) { - if (this._templateFactory) { - this._templateFactory.changeContent(content); + var $previous = $ul.find('.active:last a') + var hideEvent = $.Event('hide.bs.tab', { + relatedTarget: $this[0] + }) + var showEvent = $.Event('show.bs.tab', { + relatedTarget: $previous[0] + }) + + $previous.trigger(hideEvent) + $this.trigger(showEvent) + + if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return + + var $target = $(selector) + + this.activate($this.closest('li'), $ul) + this.activate($target, $target.parent(), function () { + $previous.trigger({ + type: 'hidden.bs.tab', + relatedTarget: $this[0] + }) + $this.trigger({ + type: 'shown.bs.tab', + relatedTarget: $previous[0] + }) + }) + } + + Tab.prototype.activate = function (element, container, callback) { + var $active = container.find('> .active') + var transition = callback + && $.support.transition + && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) + + function next() { + $active + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', false) + + element + .addClass('active') + .find('[data-toggle="tab"]') + .attr('aria-expanded', true) + + if (transition) { + element[0].offsetWidth // reflow for transition + element.addClass('in') } else { - this._templateFactory = new TemplateFactory({ - ...this._config, - // the `content` var has to be after `this._config` - // to override config.content in case of popover - content, - extraClass: this._resolvePossibleFunction(this._config.customClass) - }); + element.removeClass('fade') } - return this._templateFactory; - } - _getContentForTemplate() { - return { - [SELECTOR_TOOLTIP_INNER]: this._getTitle() - }; - } - _getTitle() { - return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); - } - // Private - _initializeOnDelegatedTarget(event) { - return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); - } - _isAnimated() { - return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); - } - _isShown() { - return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); - } - _createPopper(tip) { - const placement = execute(this._config.placement, [this, tip, this._element]); - const attachment = AttachmentMap[placement.toUpperCase()]; - return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment)); - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); - } - return offset; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this._element]); - } - _getPopperConfig(attachment) { - const defaultBsPopperConfig = { - placement: attachment, - modifiers: [{ - name: 'flip', - options: { - fallbackPlacements: this._config.fallbackPlacements - } - }, { - name: 'offset', - options: { - offset: this._getOffset() - } - }, { - name: 'preventOverflow', - options: { - boundary: this._config.boundary - } - }, { - name: 'arrow', - options: { - element: `.${this.constructor.NAME}-arrow` - } - }, { - name: 'preSetPlacement', - enabled: true, - phase: 'beforeMain', - fn: data => { - // Pre-set Popper's placement attribute in order to read the arrow sizes properly. - // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement - this._getTipElement().setAttribute('data-popper-placement', data.state.placement); - } - }] - }; - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; - } - _setListeners() { - const triggers = this._config.trigger.split(' '); - for (const trigger of triggers) { - if (trigger === 'click') { - EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context.toggle(); - }); - } else if (trigger !== TRIGGER_MANUAL) { - const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); - const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); - EventHandler.on(this._element, eventIn, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; - context._enter(); - }); - EventHandler.on(this._element, eventOut, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); - context._leave(); - }); - } - } - this._hideModalHandler = () => { - if (this._element) { - this.hide(); - } - }; - EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - } - _fixTitle() { - const title = this._element.getAttribute('title'); - if (!title) { - return; - } - if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { - this._element.setAttribute('aria-label', title); - } - this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility - this._element.removeAttribute('title'); - } - _enter() { - if (this._isShown() || this._isHovered) { - this._isHovered = true; - return; - } - this._isHovered = true; - this._setTimeout(() => { - if (this._isHovered) { - this.show(); - } - }, this._config.delay.show); - } - _leave() { - if (this._isWithActiveTrigger()) { - return; - } - this._isHovered = false; - this._setTimeout(() => { - if (!this._isHovered) { - this.hide(); - } - }, this._config.delay.hide); - } - _setTimeout(handler, timeout) { - clearTimeout(this._timeout); - this._timeout = setTimeout(handler, timeout); - } - _isWithActiveTrigger() { - return Object.values(this._activeTrigger).includes(true); - } - _getConfig(config) { - const dataAttributes = Manipulator.getDataAttributes(this._element); - for (const dataAttribute of Object.keys(dataAttributes)) { - if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { - delete dataAttributes[dataAttribute]; - } + if (element.parent('.dropdown-menu').length) { + element + .closest('li.dropdown') + .addClass('active') + .end() + .find('[data-toggle="tab"]') + .attr('aria-expanded', true) } - config = { - ...dataAttributes, - ...(typeof config === 'object' && config ? config : {}) - }; - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - config.container = config.container === false ? document.body : getElement(config.container); - if (typeof config.delay === 'number') { - config.delay = { - show: config.delay, - hide: config.delay - }; - } - if (typeof config.title === 'number') { - config.title = config.title.toString(); - } - if (typeof config.content === 'number') { - config.content = config.content.toString(); - } - return config; - } - _getDelegateConfig() { - const config = {}; - for (const [key, value] of Object.entries(this._config)) { - if (this.constructor.Default[key] !== value) { - config[key] = value; - } - } - config.selector = false; - config.trigger = 'manual'; - // In the future can be replaced with: - // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) - // `Object.fromEntries(keysWithDifferentValues)` - return config; - } - _disposePopper() { - if (this._popper) { - this._popper.destroy(); - this._popper = null; - } - if (this.tip) { - this.tip.remove(); - this.tip = null; - } + callback && callback() } - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Tooltip.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } + $active.length && transition ? + $active + .one('bsTransitionEnd', next) + .emulateTransitionEnd(Tab.TRANSITION_DURATION) : + next() + + $active.removeClass('in') } - /** - * jQuery - */ - defineJQueryPlugin(Tooltip); + // TAB PLUGIN DEFINITION + // ===================== - /** - * -------------------------------------------------------------------------- - * Bootstrap popover.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.tab') + if (!data) $this.data('bs.tab', (data = new Tab(this))) + if (typeof option == 'string') data[option]() + }) + } - /** - * Constants - */ + var old = $.fn.tab - const NAME$3 = 'popover'; - const SELECTOR_TITLE = '.popover-header'; - const SELECTOR_CONTENT = '.popover-body'; - const Default$2 = { - ...Tooltip.Default, - content: '', - offset: [0, 8], - placement: 'right', - template: '' + '' + '' + '' + '', - trigger: 'click' - }; - const DefaultType$2 = { - ...Tooltip.DefaultType, - content: '(null|string|element|function)' - }; - - /** - * Class definition - */ - - class Popover extends Tooltip { - // Getters - static get Default() { - return Default$2; - } - static get DefaultType() { - return DefaultType$2; - } - static get NAME() { - return NAME$3; - } + $.fn.tab = Plugin + $.fn.tab.Constructor = Tab - // Overrides - _isWithContent() { - return this._getTitle() || this._getContent(); - } - // Private - _getContentForTemplate() { - return { - [SELECTOR_TITLE]: this._getTitle(), - [SELECTOR_CONTENT]: this._getContent() - }; - } - _getContent() { - return this._resolvePossibleFunction(this._config.content); - } + // TAB NO CONFLICT + // =============== - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Popover.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this } - /** - * jQuery - */ - - defineJQueryPlugin(Popover); - - /** - * -------------------------------------------------------------------------- - * Bootstrap scrollspy.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$2 = 'scrollspy'; - const DATA_KEY$2 = 'bs.scrollspy'; - const EVENT_KEY$2 = `.${DATA_KEY$2}`; - const DATA_API_KEY = '.data-api'; - const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; - const EVENT_CLICK = `click${EVENT_KEY$2}`; - const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`; - const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; - const CLASS_NAME_ACTIVE$1 = 'active'; - const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; - const SELECTOR_TARGET_LINKS = '[href]'; - const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; - const SELECTOR_NAV_LINKS = '.nav-link'; - const SELECTOR_NAV_ITEMS = '.nav-item'; - const SELECTOR_LIST_ITEMS = '.list-group-item'; - const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; - const SELECTOR_DROPDOWN = '.dropdown'; - const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; - const Default$1 = { - offset: null, - // TODO: v6 @deprecated, keep it for backwards compatibility reasons - rootMargin: '0px 0px -25%', - smoothScroll: false, - target: null, - threshold: [0.1, 0.5, 1] - }; - const DefaultType$1 = { - offset: '(number|null)', - // TODO v6 @deprecated, keep it for backwards compatibility reasons - rootMargin: 'string', - smoothScroll: 'boolean', - target: 'element', - threshold: 'array' - }; - - /** - * Class definition - */ - - class ScrollSpy extends BaseComponent { - constructor(element, config) { - super(element, config); - - // this._element is the observablesContainer and config.target the menu links wrapper - this._targetLinks = new Map(); - this._observableSections = new Map(); - this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; - this._activeTarget = null; - this._observer = null; - this._previousScrollData = { - visibleEntryTop: 0, - parentScrollTop: 0 - }; - this.refresh(); // initialize - } - // Getters - static get Default() { - return Default$1; - } - static get DefaultType() { - return DefaultType$1; - } - static get NAME() { - return NAME$2; - } + // TAB DATA-API + // ============ - // Public - refresh() { - this._initializeTargetsAndObservables(); - this._maybeEnableSmoothScroll(); - if (this._observer) { - this._observer.disconnect(); - } else { - this._observer = this._getNewObserver(); - } - for (const section of this._observableSections.values()) { - this._observer.observe(section); - } - } - dispose() { - this._observer.disconnect(); - super.dispose(); - } + var clickHandler = function (e) { + e.preventDefault() + Plugin.call($(this), 'show') + } - // Private - _configAfterMerge(config) { - // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case - config.target = getElement(config.target) || document.body; + $(document) + .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) + .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) - // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only - config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin; - if (typeof config.threshold === 'string') { - config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value)); - } - return config; - } - _maybeEnableSmoothScroll() { - if (!this._config.smoothScroll) { - return; - } +}(jQuery); - // unregister any previous listeners - EventHandler.off(this._config.target, EVENT_CLICK); - EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { - const observableSection = this._observableSections.get(event.target.hash); - if (observableSection) { - event.preventDefault(); - const root = this._rootElement || window; - const height = observableSection.offsetTop - this._element.offsetTop; - if (root.scrollTo) { - root.scrollTo({ - top: height, - behavior: 'smooth' - }); - return; - } - - // Chrome 60 doesn't support `scrollTo` - root.scrollTop = height; - } - }); - } - _getNewObserver() { - const options = { - root: this._rootElement, - threshold: this._config.threshold, - rootMargin: this._config.rootMargin - }; - return new IntersectionObserver(entries => this._observerCallback(entries), options); - } +/* ======================================================================== + * Bootstrap: affix.js v3.3.7 + * http://getbootstrap.com/javascript/#affix + * ======================================================================== + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ - // The logic of selection - _observerCallback(entries) { - const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); - const activate = entry => { - this._previousScrollData.visibleEntryTop = entry.target.offsetTop; - this._process(targetElement(entry)); - }; - const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; - const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; - this._previousScrollData.parentScrollTop = parentScrollTop; - for (const entry of entries) { - if (!entry.isIntersecting) { - this._activeTarget = null; - this._clearActiveClass(targetElement(entry)); - continue; - } - const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; - // if we are scrolling down, pick the bigger offsetTop - if (userScrollsDown && entryIsLowerThanPrevious) { - activate(entry); - // if parent isn't scrolled, let's keep the first visible item, breaking the iteration - if (!parentScrollTop) { - return; - } - continue; - } - // if we are scrolling up, pick the smallest offsetTop - if (!userScrollsDown && !entryIsLowerThanPrevious) { - activate(entry); - } - } - } - _initializeTargetsAndObservables() { - this._targetLinks = new Map(); - this._observableSections = new Map(); - const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); - for (const anchor of targetLinks) { - // ensure that the anchor has an id and is not disabled - if (!anchor.hash || isDisabled(anchor)) { - continue; - } - const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); ++function ($) { + 'use strict'; - // ensure that the observableSection exists & is visible - if (isVisible(observableSection)) { - this._targetLinks.set(decodeURI(anchor.hash), anchor); - this._observableSections.set(anchor.hash, observableSection); - } - } - } - _process(target) { - if (this._activeTarget === target) { - return; - } - this._clearActiveClass(this._config.target); - this._activeTarget = target; - target.classList.add(CLASS_NAME_ACTIVE$1); - this._activateParents(target); - EventHandler.trigger(this._element, EVENT_ACTIVATE, { - relatedTarget: target - }); - } - _activateParents(target) { - // Activate dropdown parents - if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { - SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1); - return; - } - for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) { - // Set triggered links parents as active - // With both and markup a parent is the previous sibling of any nav ancestor - for (const item of SelectorEngine.prev(listGroup, SELECTOR_LINK_ITEMS)) { - item.classList.add(CLASS_NAME_ACTIVE$1); - } - } - } - _clearActiveClass(parent) { - parent.classList.remove(CLASS_NAME_ACTIVE$1); - const activeNodes = SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`, parent); - for (const node of activeNodes) { - node.classList.remove(CLASS_NAME_ACTIVE$1); - } - } + // AFFIX CLASS DEFINITION + // ====================== - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = ScrollSpy.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } + var Affix = function (element, options) { + this.options = $.extend({}, Affix.DEFAULTS, options) + + this.$target = $(this.options.target) + .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) + + this.$element = $(element) + this.affixed = null + this.unpin = null + this.pinnedOffset = null + + this.checkPosition() } - /** - * Data API implementation - */ + Affix.VERSION = '3.3.7' - EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => { - for (const spy of SelectorEngine.find(SELECTOR_DATA_SPY)) { - ScrollSpy.getOrCreateInstance(spy); - } - }); - - /** - * jQuery - */ - - defineJQueryPlugin(ScrollSpy); - - /** - * -------------------------------------------------------------------------- - * Bootstrap tab.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME$1 = 'tab'; - const DATA_KEY$1 = 'bs.tab'; - const EVENT_KEY$1 = `.${DATA_KEY$1}`; - const EVENT_HIDE$1 = `hide${EVENT_KEY$1}`; - const EVENT_HIDDEN$1 = `hidden${EVENT_KEY$1}`; - const EVENT_SHOW$1 = `show${EVENT_KEY$1}`; - const EVENT_SHOWN$1 = `shown${EVENT_KEY$1}`; - const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}`; - const EVENT_KEYDOWN = `keydown${EVENT_KEY$1}`; - const EVENT_LOAD_DATA_API = `load${EVENT_KEY$1}`; - const ARROW_LEFT_KEY = 'ArrowLeft'; - const ARROW_RIGHT_KEY = 'ArrowRight'; - const ARROW_UP_KEY = 'ArrowUp'; - const ARROW_DOWN_KEY = 'ArrowDown'; - const HOME_KEY = 'Home'; - const END_KEY = 'End'; - const CLASS_NAME_ACTIVE = 'active'; - const CLASS_NAME_FADE$1 = 'fade'; - const CLASS_NAME_SHOW$1 = 'show'; - const CLASS_DROPDOWN = 'dropdown'; - const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; - const SELECTOR_DROPDOWN_MENU = '.dropdown-menu'; - const NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`; - const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'; - const SELECTOR_OUTER = '.nav-item, .list-group-item'; - const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`; - const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6 - const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`; - const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`; - - /** - * Class definition - */ - - class Tab extends BaseComponent { - constructor(element) { - super(element); - this._parent = this._element.closest(SELECTOR_TAB_PANEL); - if (!this._parent) { - return; - // TODO: should throw exception in v6 - // throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`) - } + Affix.RESET = 'affix affix-top affix-bottom' - // Set up initial aria attributes - this._setInitialAttributes(this._parent, this._getChildren()); - EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); - } + Affix.DEFAULTS = { + offset: 0, + target: window + } - // Getters - static get NAME() { - return NAME$1; - } + Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + var targetHeight = this.$target.height() - // Public - show() { - // Shows this elem and deactivate the active sibling if exists - const innerElem = this._element; - if (this._elemIsActive(innerElem)) { - return; - } + if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false - // Search for active tab on same parent to deactivate it - const active = this._getActiveElem(); - const hideEvent = active ? EventHandler.trigger(active, EVENT_HIDE$1, { - relatedTarget: innerElem - }) : null; - const showEvent = EventHandler.trigger(innerElem, EVENT_SHOW$1, { - relatedTarget: active - }); - if (showEvent.defaultPrevented || hideEvent && hideEvent.defaultPrevented) { - return; - } - this._deactivate(active, innerElem); - this._activate(innerElem, active); + if (this.affixed == 'bottom') { + if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' + return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' } - // Private - _activate(element, relatedElem) { - if (!element) { - return; - } - element.classList.add(CLASS_NAME_ACTIVE); - this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section + var initializing = this.affixed == null + var colliderTop = initializing ? scrollTop : position.top + var colliderHeight = initializing ? targetHeight : height - const complete = () => { - if (element.getAttribute('role') !== 'tab') { - element.classList.add(CLASS_NAME_SHOW$1); - return; - } - element.removeAttribute('tabindex'); - element.setAttribute('aria-selected', true); - this._toggleDropDown(element, true); - EventHandler.trigger(element, EVENT_SHOWN$1, { - relatedTarget: relatedElem - }); - }; - this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); - } - _deactivate(element, relatedElem) { - if (!element) { - return; - } - element.classList.remove(CLASS_NAME_ACTIVE); - element.blur(); - this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too - - const complete = () => { - if (element.getAttribute('role') !== 'tab') { - element.classList.remove(CLASS_NAME_SHOW$1); - return; - } - element.setAttribute('aria-selected', false); - element.setAttribute('tabindex', '-1'); - this._toggleDropDown(element, false); - EventHandler.trigger(element, EVENT_HIDDEN$1, { - relatedTarget: relatedElem - }); - }; - this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1)); - } - _keydown(event) { - if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) { - return; - } - event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page - event.preventDefault(); - const children = this._getChildren().filter(element => !isDisabled(element)); - let nextActiveElement; - if ([HOME_KEY, END_KEY].includes(event.key)) { - nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1]; - } else { - const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key); - nextActiveElement = getNextActiveElement(children, event.target, isNext, true); - } - if (nextActiveElement) { - nextActiveElement.focus({ - preventScroll: true - }); - Tab.getOrCreateInstance(nextActiveElement).show(); - } - } - _getChildren() { - // collection of inner elements - return SelectorEngine.find(SELECTOR_INNER_ELEM, this._parent); - } - _getActiveElem() { - return this._getChildren().find(child => this._elemIsActive(child)) || null; - } - _setInitialAttributes(parent, children) { - this._setAttributeIfNotExists(parent, 'role', 'tablist'); - for (const child of children) { - this._setInitialAttributesOnChild(child); - } - } - _setInitialAttributesOnChild(child) { - child = this._getInnerElement(child); - const isActive = this._elemIsActive(child); - const outerElem = this._getOuterElement(child); - child.setAttribute('aria-selected', isActive); - if (outerElem !== child) { - this._setAttributeIfNotExists(outerElem, 'role', 'presentation'); - } - if (!isActive) { - child.setAttribute('tabindex', '-1'); - } - this._setAttributeIfNotExists(child, 'role', 'tab'); + if (offsetTop != null && scrollTop <= offsetTop) return 'top' + if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' - // set attributes to the related panel too - this._setInitialAttributesOnTargetPanel(child); - } - _setInitialAttributesOnTargetPanel(child) { - const target = SelectorEngine.getElementFromSelector(child); - if (!target) { - return; - } - this._setAttributeIfNotExists(target, 'role', 'tabpanel'); - if (child.id) { - this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`); - } - } - _toggleDropDown(element, open) { - const outerElem = this._getOuterElement(element); - if (!outerElem.classList.contains(CLASS_DROPDOWN)) { - return; - } - const toggle = (selector, className) => { - const element = SelectorEngine.findOne(selector, outerElem); - if (element) { - element.classList.toggle(className, open); - } - }; - toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE); - toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1); - outerElem.setAttribute('aria-expanded', open); - } - _setAttributeIfNotExists(element, attribute, value) { - if (!element.hasAttribute(attribute)) { - element.setAttribute(attribute, value); - } - } - _elemIsActive(elem) { - return elem.classList.contains(CLASS_NAME_ACTIVE); - } + return false + } - // Try to get the inner element (usually the .nav-link) - _getInnerElement(elem) { - return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem); - } + Affix.prototype.getPinnedOffset = function () { + if (this.pinnedOffset) return this.pinnedOffset + this.$element.removeClass(Affix.RESET).addClass('affix') + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + return (this.pinnedOffset = position.top - scrollTop) + } + + Affix.prototype.checkPositionWithEventLoop = function () { + setTimeout($.proxy(this.checkPosition, this), 1) + } - // Try to get the outer element (usually the .nav-item) - _getOuterElement(elem) { - return elem.closest(SELECTOR_OUTER) || elem; + Affix.prototype.checkPosition = function () { + if (!this.$element.is(':visible')) return + + var height = this.$element.height() + var offset = this.options.offset + var offsetTop = offset.top + var offsetBottom = offset.bottom + var scrollHeight = Math.max($(document).height(), $(document.body).height()) + + if (typeof offset != 'object') offsetBottom = offsetTop = offset + if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) + + var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) + + if (this.affixed != affix) { + if (this.unpin != null) this.$element.css('top', '') + + var affixType = 'affix' + (affix ? '-' + affix : '') + var e = $.Event(affixType + '.bs.affix') + + this.$element.trigger(e) + + if (e.isDefaultPrevented()) return + + this.affixed = affix + this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') } - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Tab.getOrCreateInstance(this); - if (typeof config !== 'string') { - return; - } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); + if (affix == 'bottom') { + this.$element.offset({ + top: scrollHeight - height - offsetBottom + }) } } - /** - * Data API implementation - */ - EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } - if (isDisabled(this)) { - return; - } - Tab.getOrCreateInstance(this).show(); - }); - - /** - * Initialize on focus - */ - EventHandler.on(window, EVENT_LOAD_DATA_API, () => { - for (const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)) { - Tab.getOrCreateInstance(element); - } - }); - /** - * jQuery - */ - - defineJQueryPlugin(Tab); - - /** - * -------------------------------------------------------------------------- - * Bootstrap toast.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - - /** - * Constants - */ - - const NAME = 'toast'; - const DATA_KEY = 'bs.toast'; - const EVENT_KEY = `.${DATA_KEY}`; - const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`; - const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`; - const EVENT_FOCUSIN = `focusin${EVENT_KEY}`; - const EVENT_FOCUSOUT = `focusout${EVENT_KEY}`; - const EVENT_HIDE = `hide${EVENT_KEY}`; - const EVENT_HIDDEN = `hidden${EVENT_KEY}`; - const EVENT_SHOW = `show${EVENT_KEY}`; - const EVENT_SHOWN = `shown${EVENT_KEY}`; - const CLASS_NAME_FADE = 'fade'; - const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility - const CLASS_NAME_SHOW = 'show'; - const CLASS_NAME_SHOWING = 'showing'; - const DefaultType = { - animation: 'boolean', - autohide: 'boolean', - delay: 'number' - }; - const Default = { - animation: true, - autohide: true, - delay: 5000 - }; - - /** - * Class definition - */ - - class Toast extends BaseComponent { - constructor(element, config) { - super(element, config); - this._timeout = null; - this._hasMouseInteraction = false; - this._hasKeyboardInteraction = false; - this._setListeners(); - } + // AFFIX PLUGIN DEFINITION + // ======================= - // Getters - static get Default() { - return Default; - } - static get DefaultType() { - return DefaultType; - } - static get NAME() { - return NAME; - } + function Plugin(option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.affix') + var options = typeof option == 'object' && option - // Public - show() { - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW); - if (showEvent.defaultPrevented) { - return; - } - this._clearTimeout(); - if (this._config.animation) { - this._element.classList.add(CLASS_NAME_FADE); - } - const complete = () => { - this._element.classList.remove(CLASS_NAME_SHOWING); - EventHandler.trigger(this._element, EVENT_SHOWN); - this._maybeScheduleHide(); - }; - this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated - reflow(this._element); - this._element.classList.add(CLASS_NAME_SHOW, CLASS_NAME_SHOWING); - this._queueCallback(complete, this._element, this._config.animation); - } - hide() { - if (!this.isShown()) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); - if (hideEvent.defaultPrevented) { - return; - } - const complete = () => { - this._element.classList.add(CLASS_NAME_HIDE); // @deprecated - this._element.classList.remove(CLASS_NAME_SHOWING, CLASS_NAME_SHOW); - EventHandler.trigger(this._element, EVENT_HIDDEN); - }; - this._element.classList.add(CLASS_NAME_SHOWING); - this._queueCallback(complete, this._element, this._config.animation); - } - dispose() { - this._clearTimeout(); - if (this.isShown()) { - this._element.classList.remove(CLASS_NAME_SHOW); - } - super.dispose(); - } - isShown() { - return this._element.classList.contains(CLASS_NAME_SHOW); - } + if (!data) $this.data('bs.affix', (data = new Affix(this, options))) + if (typeof option == 'string') data[option]() + }) + } - // Private + var old = $.fn.affix - _maybeScheduleHide() { - if (!this._config.autohide) { - return; - } - if (this._hasMouseInteraction || this._hasKeyboardInteraction) { - return; - } - this._timeout = setTimeout(() => { - this.hide(); - }, this._config.delay); - } - _onInteraction(event, isInteracting) { - switch (event.type) { - case 'mouseover': - case 'mouseout': - { - this._hasMouseInteraction = isInteracting; - break; - } - case 'focusin': - case 'focusout': - { - this._hasKeyboardInteraction = isInteracting; - break; - } - } - if (isInteracting) { - this._clearTimeout(); - return; - } - const nextElement = event.relatedTarget; - if (this._element === nextElement || this._element.contains(nextElement)) { - return; - } - this._maybeScheduleHide(); - } - _setListeners() { - EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true)); - EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false)); - EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true)); - EventHandler.on(this._element, EVENT_FOCUSOUT, event => this._onInteraction(event, false)); - } - _clearTimeout() { - clearTimeout(this._timeout); - this._timeout = null; - } + $.fn.affix = Plugin + $.fn.affix.Constructor = Affix - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Toast.getOrCreateInstance(this, config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); - } - }); - } + + // AFFIX NO CONFLICT + // ================= + + $.fn.affix.noConflict = function () { + $.fn.affix = old + return this } - /** - * Data API implementation - */ - - enableDismissTrigger(Toast); - - /** - * jQuery - */ - - defineJQueryPlugin(Toast); - - /** - * -------------------------------------------------------------------------- - * Bootstrap index.umd.js - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - * -------------------------------------------------------------------------- - */ - - const index_umd = { - Alert, - Button, - Carousel, - Collapse, - Dropdown, - Modal, - Offcanvas, - Popover, - ScrollSpy, - Tab, - Toast, - Tooltip - }; - - return index_umd; - -})); -//# sourceMappingURL=bootstrap.js.map \ No newline at end of file + + // AFFIX DATA-API + // ============== + + $(window).on('load', function () { + $('[data-spy="affix"]').each(function () { + var $spy = $(this) + var data = $spy.data() + + data.offset = data.offset || {} + + if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom + if (data.offsetTop != null) data.offset.top = data.offsetTop + + Plugin.call($spy, data) + }) + }) + +}(jQuery); diff --git a/examples/libs/bootstrap.min.css b/examples/libs/bootstrap.min.css index 7d43753..0cf286f 100644 --- a/examples/libs/bootstrap.min.css +++ b/examples/libs/bootstrap.min.css @@ -1,6 +1,6 @@ -@charset "UTF-8";/*! - * Bootstrap v5.3.3 (https://getbootstrap.com/) - * Copyright 2011-2024 The Bootstrap Authors - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */:root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13,110,253;--bs-secondary-rgb:108,117,125;--bs-success-rgb:25,135,84;--bs-info-rgb:13,202,240;--bs-warning-rgb:255,193,7;--bs-danger-rgb:220,53,69;--bs-light-rgb:248,249,250;--bs-dark-rgb:33,37,41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs-warning-bg-subtle:#fff3cd;--bs-danger-bg-subtle:#f8d7da;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#9ec5fe;--bs-secondary-border-subtle:#c4c8cb;--bs-success-border-subtle:#a3cfbb;--bs-info-border-subtle:#9eeaf9;--bs-warning-border-subtle:#ffe69c;--bs-danger-border-subtle:#f1aeb5;--bs-light-border-subtle:#e9ecef;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255,255,255;--bs-black-rgb:0,0,0;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans","Liberation Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-color-rgb:33,37,41;--bs-body-bg:#fff;--bs-body-bg-rgb:255,255,255;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0,0,0;--bs-secondary-color:rgba(33, 37, 41, 0.75);--bs-secondary-color-rgb:33,37,41;--bs-secondary-bg:#e9ecef;--bs-secondary-bg-rgb:233,236,239;--bs-tertiary-color:rgba(33, 37, 41, 0.5);--bs-tertiary-color-rgb:33,37,41;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248,249,250;--bs-heading-color:inherit;--bs-link-color:#0d6efd;--bs-link-color-rgb:13,110,253;--bs-link-decoration:underline;--bs-link-hover-color:#0a58ca;--bs-link-hover-color-rgb:10,88,202;--bs-code-color:#d63384;--bs-highlight-color:#212529;--bs-highlight-bg:#fff3cd;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(13, 110, 253, 0.25);--bs-form-valid-color:#198754;--bs-form-valid-border-color:#198754;--bs-form-invalid-color:#dc3545;--bs-form-invalid-border-color:#dc3545}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222,226,230;--bs-body-bg:#212529;--bs-body-bg-rgb:33,37,41;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255,255,255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222,226,230;--bs-secondary-bg:#343a40;--bs-secondary-bg-rgb:52,58,64;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222,226,230;--bs-tertiary-bg:#2b3035;--bs-tertiary-bg-rgb:43,48,53;--bs-primary-text-emphasis:#6ea8fe;--bs-secondary-text-emphasis:#a7acb1;--bs-success-text-emphasis:#75b798;--bs-info-text-emphasis:#6edff6;--bs-warning-text-emphasis:#ffda6a;--bs-danger-text-emphasis:#ea868f;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#031633;--bs-secondary-bg-subtle:#161719;--bs-success-bg-subtle:#051b11;--bs-info-bg-subtle:#032830;--bs-warning-bg-subtle:#332701;--bs-danger-bg-subtle:#2c0b0e;--bs-light-bg-subtle:#343a40;--bs-dark-bg-subtle:#1a1d20;--bs-primary-border-subtle:#084298;--bs-secondary-border-subtle:#41464b;--bs-success-border-subtle:#0f5132;--bs-info-border-subtle:#087990;--bs-warning-border-subtle:#997404;--bs-danger-border-subtle:#842029;--bs-light-border-subtle:#495057;--bs-dark-border-subtle:#343a40;--bs-heading-color:inherit;--bs-link-color:#6ea8fe;--bs-link-hover-color:#8bb9fe;--bs-link-color-rgb:110,168,254;--bs-link-hover-color-rgb:139,185,254;--bs-code-color:#e685b5;--bs-highlight-color:#dee2e6;--bs-highlight-bg:#664d03;--bs-border-color:#495057;--bs-border-color-translucent:rgba(255, 255, 255, 0.15);--bs-form-valid-color:#75b798;--bs-form-valid-border-color:#75b798;--bs-form-invalid-color:#ea868f;--bs-form-invalid-border-color:#ea868f}*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;border:0;border-top:var(--bs-border-width) solid;opacity:.25}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2;color:var(--bs-heading-color)}.h1,h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){.h1,h1{font-size:2.5rem}}.h2,h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){.h2,h2{font-size:2rem}}.h3,h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){.h3,h3{font-size:1.75rem}}.h4,h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){.h4,h4{font-size:1.5rem}}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}.small,small{font-size:.875em}.mark,mark{padding:.1875em;color:var(--bs-highlight-color);background-color:var(--bs-highlight-bg)}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1));text-decoration:underline}a:hover{--bs-link-color-rgb:var(--bs-link-hover-color-rgb)}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:var(--bs-font-monospace);font-size:1em}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:var(--bs-code-color);word-wrap:break-word}a>code{color:inherit}kbd{padding:.1875rem .375rem;font-size:.875em;color:var(--bs-body-bg);background-color:var(--bs-body-color);border-radius:.25rem}kbd kbd{padding:0;font-size:1em}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-secondary-color);text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none!important}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}::file-selector-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-6{font-size:2.5rem}}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:.875em;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{margin-top:-1rem;margin-bottom:1rem;font-size:.875em;color:#6c757d}.blockquote-footer::before{content:"— "}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:.875em;color:var(--bs-secondary-color)}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{--bs-gutter-x:1.5rem;--bs-gutter-y:0;width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}@media (min-width:1400px){.container,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{max-width:1320px}}:root{--bs-breakpoint-xs:0;--bs-breakpoint-sm:576px;--bs-breakpoint-md:768px;--bs-breakpoint-lg:992px;--bs-breakpoint-xl:1200px;--bs-breakpoint-xxl:1400px}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-.5 * var(--bs-gutter-x));margin-left:calc(-.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.66666667%}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.33333333%}.col-2{flex:0 0 auto;width:16.66666667%}.col-3{flex:0 0 auto;width:25%}.col-4{flex:0 0 auto;width:33.33333333%}.col-5{flex:0 0 auto;width:41.66666667%}.col-6{flex:0 0 auto;width:50%}.col-7{flex:0 0 auto;width:58.33333333%}.col-8{flex:0 0 auto;width:66.66666667%}.col-9{flex:0 0 auto;width:75%}.col-10{flex:0 0 auto;width:83.33333333%}.col-11{flex:0 0 auto;width:91.66666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x:0}.g-0,.gy-0{--bs-gutter-y:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-1,.gy-1{--bs-gutter-y:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-2,.gy-2{--bs-gutter-y:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-3,.gy-3{--bs-gutter-y:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-4,.gy-4{--bs-gutter-y:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}.g-5,.gy-5{--bs-gutter-y:3rem}@media (min-width:576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.66666667%}.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.33333333%}.col-sm-2{flex:0 0 auto;width:16.66666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.33333333%}.col-sm-5{flex:0 0 auto;width:41.66666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.33333333%}.col-sm-8{flex:0 0 auto;width:66.66666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.33333333%}.col-sm-11{flex:0 0 auto;width:91.66666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x:0}.g-sm-0,.gy-sm-0{--bs-gutter-y:0}.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y:0.25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y:0.5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y:1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y:1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y:3rem}}@media (min-width:768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.66666667%}.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.33333333%}.col-md-2{flex:0 0 auto;width:16.66666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.33333333%}.col-md-5{flex:0 0 auto;width:41.66666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.33333333%}.col-md-8{flex:0 0 auto;width:66.66666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.33333333%}.col-md-11{flex:0 0 auto;width:91.66666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x:0}.g-md-0,.gy-md-0{--bs-gutter-y:0}.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}.g-md-1,.gy-md-1{--bs-gutter-y:0.25rem}.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}.g-md-2,.gy-md-2{--bs-gutter-y:0.5rem}.g-md-3,.gx-md-3{--bs-gutter-x:1rem}.g-md-3,.gy-md-3{--bs-gutter-y:1rem}.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y:1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x:3rem}.g-md-5,.gy-md-5{--bs-gutter-y:3rem}}@media (min-width:992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.66666667%}.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.33333333%}.col-lg-2{flex:0 0 auto;width:16.66666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.33333333%}.col-lg-5{flex:0 0 auto;width:41.66666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.33333333%}.col-lg-8{flex:0 0 auto;width:66.66666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-11{flex:0 0 auto;width:91.66666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x:0}.g-lg-0,.gy-lg-0{--bs-gutter-y:0}.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y:0.25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y:0.5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y:1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y:1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y:3rem}}@media (min-width:1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.66666667%}.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.33333333%}.col-xl-2{flex:0 0 auto;width:16.66666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.33333333%}.col-xl-5{flex:0 0 auto;width:41.66666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.33333333%}.col-xl-8{flex:0 0 auto;width:66.66666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.33333333%}.col-xl-11{flex:0 0 auto;width:91.66666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x:0}.g-xl-0,.gy-xl-0{--bs-gutter-y:0}.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y:0.25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y:0.5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y:1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y:1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y:3rem}}@media (min-width:1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.33333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.66666667%}.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.33333333%}.col-xxl-2{flex:0 0 auto;width:16.66666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.33333333%}.col-xxl-5{flex:0 0 auto;width:41.66666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.33333333%}.col-xxl-8{flex:0 0 auto;width:66.66666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.33333333%}.col-xxl-11{flex:0 0 auto;width:91.66666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y:0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y:0.25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y:0.5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y:1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y:1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y:3rem}}.table{--bs-table-color-type:initial;--bs-table-bg-type:initial;--bs-table-color-state:initial;--bs-table-bg-state:initial;--bs-table-color:var(--bs-emphasis-color);--bs-table-bg:var(--bs-body-bg);--bs-table-border-color:var(--bs-border-color);--bs-table-accent-bg:transparent;--bs-table-striped-color:var(--bs-emphasis-color);--bs-table-striped-bg:rgba(var(--bs-emphasis-color-rgb), 0.05);--bs-table-active-color:var(--bs-emphasis-color);--bs-table-active-bg:rgba(var(--bs-emphasis-color-rgb), 0.1);--bs-table-hover-color:var(--bs-emphasis-color);--bs-table-hover-bg:rgba(var(--bs-emphasis-color-rgb), 0.075);width:100%;margin-bottom:1rem;vertical-align:top;border-color:var(--bs-table-border-color)}.table>:not(caption)>*>*{padding:.5rem .5rem;color:var(--bs-table-color-state,var(--bs-table-color-type,var(--bs-table-color)));background-color:var(--bs-table-bg);border-bottom-width:var(--bs-border-width);box-shadow:inset 0 0 0 9999px var(--bs-table-bg-state,var(--bs-table-bg-type,var(--bs-table-accent-bg)))}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table-group-divider{border-top:calc(var(--bs-border-width) * 2) solid currentcolor}.caption-top{caption-side:top}.table-sm>:not(caption)>*>*{padding:.25rem .25rem}.table-bordered>:not(caption)>*{border-width:var(--bs-border-width) 0}.table-bordered>:not(caption)>*>*{border-width:0 var(--bs-border-width)}.table-borderless>:not(caption)>*>*{border-bottom-width:0}.table-borderless>:not(:first-child){border-top-width:0}.table-striped>tbody>tr:nth-of-type(odd)>*{--bs-table-color-type:var(--bs-table-striped-color);--bs-table-bg-type:var(--bs-table-striped-bg)}.table-striped-columns>:not(caption)>tr>:nth-child(2n){--bs-table-color-type:var(--bs-table-striped-color);--bs-table-bg-type:var(--bs-table-striped-bg)}.table-active{--bs-table-color-state:var(--bs-table-active-color);--bs-table-bg-state:var(--bs-table-active-bg)}.table-hover>tbody>tr:hover>*{--bs-table-color-state:var(--bs-table-hover-color);--bs-table-bg-state:var(--bs-table-hover-bg)}.table-primary{--bs-table-color:#000;--bs-table-bg:#cfe2ff;--bs-table-border-color:#a6b5cc;--bs-table-striped-bg:#c5d7f2;--bs-table-striped-color:#000;--bs-table-active-bg:#bacbe6;--bs-table-active-color:#000;--bs-table-hover-bg:#bfd1ec;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-secondary{--bs-table-color:#000;--bs-table-bg:#e2e3e5;--bs-table-border-color:#b5b6b7;--bs-table-striped-bg:#d7d8da;--bs-table-striped-color:#000;--bs-table-active-bg:#cbccce;--bs-table-active-color:#000;--bs-table-hover-bg:#d1d2d4;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-success{--bs-table-color:#000;--bs-table-bg:#d1e7dd;--bs-table-border-color:#a7b9b1;--bs-table-striped-bg:#c7dbd2;--bs-table-striped-color:#000;--bs-table-active-bg:#bcd0c7;--bs-table-active-color:#000;--bs-table-hover-bg:#c1d6cc;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-info{--bs-table-color:#000;--bs-table-bg:#cff4fc;--bs-table-border-color:#a6c3ca;--bs-table-striped-bg:#c5e8ef;--bs-table-striped-color:#000;--bs-table-active-bg:#badce3;--bs-table-active-color:#000;--bs-table-hover-bg:#bfe2e9;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-warning{--bs-table-color:#000;--bs-table-bg:#fff3cd;--bs-table-border-color:#ccc2a4;--bs-table-striped-bg:#f2e7c3;--bs-table-striped-color:#000;--bs-table-active-bg:#e6dbb9;--bs-table-active-color:#000;--bs-table-hover-bg:#ece1be;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-danger{--bs-table-color:#000;--bs-table-bg:#f8d7da;--bs-table-border-color:#c6acae;--bs-table-striped-bg:#eccccf;--bs-table-striped-color:#000;--bs-table-active-bg:#dfc2c4;--bs-table-active-color:#000;--bs-table-hover-bg:#e5c7ca;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-light{--bs-table-color:#000;--bs-table-bg:#f8f9fa;--bs-table-border-color:#c6c7c8;--bs-table-striped-bg:#ecedee;--bs-table-striped-color:#000;--bs-table-active-bg:#dfe0e1;--bs-table-active-color:#000;--bs-table-hover-bg:#e5e6e7;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-dark{--bs-table-color:#fff;--bs-table-bg:#212529;--bs-table-border-color:#4d5154;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}@media (max-width:575.98px){.table-responsive-sm{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:767.98px){.table-responsive-md{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:991.98px){.table-responsive-lg{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:1199.98px){.table-responsive-xl{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:1399.98px){.table-responsive-xxl{overflow-x:auto;-webkit-overflow-scrolling:touch}}.form-label{margin-bottom:.5rem}.col-form-label{padding-top:calc(.375rem + var(--bs-border-width));padding-bottom:calc(.375rem + var(--bs-border-width));margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + var(--bs-border-width));padding-bottom:calc(.5rem + var(--bs-border-width));font-size:1.25rem}.col-form-label-sm{padding-top:calc(.25rem + var(--bs-border-width));padding-bottom:calc(.25rem + var(--bs-border-width));font-size:.875rem}.form-text{margin-top:.25rem;font-size:.875em;color:var(--bs-secondary-color)}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--bs-body-bg);background-clip:padding-box;border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control[type=file]{overflow:hidden}.form-control[type=file]:not(:disabled):not([readonly]){cursor:pointer}.form-control:focus{color:var(--bs-body-color);background-color:var(--bs-body-bg);border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-control::-webkit-date-and-time-value{min-width:85px;height:1.5em;margin:0}.form-control::-webkit-datetime-edit{display:block;padding:0}.form-control::-moz-placeholder{color:var(--bs-secondary-color);opacity:1}.form-control::placeholder{color:var(--bs-secondary-color);opacity:1}.form-control:disabled{background-color:var(--bs-secondary-bg);opacity:1}.form-control::-webkit-file-upload-button{padding:.375rem .75rem;margin:-.375rem -.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:var(--bs-body-color);background-color:var(--bs-tertiary-bg);pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:var(--bs-border-width);border-radius:0;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.form-control::file-selector-button{padding:.375rem .75rem;margin:-.375rem -.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:var(--bs-body-color);background-color:var(--bs-tertiary-bg);pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:var(--bs-border-width);border-radius:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control::-webkit-file-upload-button{-webkit-transition:none;transition:none}.form-control::file-selector-button{transition:none}}.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button{background-color:var(--bs-secondary-bg)}.form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:var(--bs-secondary-bg)}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;line-height:1.5;color:var(--bs-body-color);background-color:transparent;border:solid transparent;border-width:var(--bs-border-width) 0}.form-control-plaintext:focus{outline:0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{min-height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2));padding:.25rem .5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}.form-control-sm::-webkit-file-upload-button{padding:.25rem .5rem;margin:-.25rem -.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.form-control-sm::file-selector-button{padding:.25rem .5rem;margin:-.25rem -.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.form-control-lg{min-height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2));padding:.5rem 1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.form-control-lg::-webkit-file-upload-button{padding:.5rem 1rem;margin:-.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.form-control-lg::file-selector-button{padding:.5rem 1rem;margin:-.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}textarea.form-control{min-height:calc(1.5em + .75rem + calc(var(--bs-border-width) * 2))}textarea.form-control-sm{min-height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2))}textarea.form-control-lg{min-height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2))}.form-control-color{width:3rem;height:calc(1.5em + .75rem + calc(var(--bs-border-width) * 2));padding:.375rem}.form-control-color:not(:disabled):not([readonly]){cursor:pointer}.form-control-color::-moz-color-swatch{border:0!important;border-radius:var(--bs-border-radius)}.form-control-color::-webkit-color-swatch{border:0!important;border-radius:var(--bs-border-radius)}.form-control-color.form-control-sm{height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2))}.form-control-color.form-control-lg{height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2))}.form-select{--bs-form-select-bg-img:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--bs-body-bg);background-image:var(--bs-form-select-bg-img),var(--bs-form-select-bg-icon,none);background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-select{transition:none}}.form-select:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-select[multiple],.form-select[size]:not([size="1"]){padding-right:.75rem;background-image:none}.form-select:disabled{background-color:var(--bs-secondary-bg)}.form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 var(--bs-body-color)}.form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}.form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}[data-bs-theme=dark] .form-select{--bs-form-select-bg-img:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}.form-check{display:block;min-height:1.5rem;padding-left:1.5em;margin-bottom:.125rem}.form-check .form-check-input{float:left;margin-left:-1.5em}.form-check-reverse{padding-right:1.5em;padding-left:0;text-align:right}.form-check-reverse .form-check-input{float:right;margin-right:-1.5em;margin-left:0}.form-check-input{--bs-form-check-bg:var(--bs-body-bg);flex-shrink:0;width:1em;height:1em;margin-top:.25em;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--bs-form-check-bg);background-image:var(--bs-form-check-bg-image);background-repeat:no-repeat;background-position:center;background-size:contain;border:var(--bs-border-width) solid var(--bs-border-color);-webkit-print-color-adjust:exact;color-adjust:exact;print-color-adjust:exact}.form-check-input[type=checkbox]{border-radius:.25em}.form-check-input[type=radio]{border-radius:50%}.form-check-input:active{filter:brightness(90%)}.form-check-input:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-check-input:checked{background-color:#0d6efd;border-color:#0d6efd}.form-check-input:checked[type=checkbox]{--bs-form-check-bg-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e")}.form-check-input:checked[type=radio]{--bs-form-check-bg-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e")}.form-check-input[type=checkbox]:indeterminate{background-color:#0d6efd;border-color:#0d6efd;--bs-form-check-bg-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e")}.form-check-input:disabled{pointer-events:none;filter:none;opacity:.5}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:default;opacity:.5}.form-switch{padding-left:2.5em}.form-switch .form-check-input{--bs-form-switch-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");width:2em;margin-left:-2.5em;background-image:var(--bs-form-switch-bg);background-position:left center;border-radius:2em;transition:background-position .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-switch .form-check-input{transition:none}}.form-switch .form-check-input:focus{--bs-form-switch-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2386b7fe'/%3e%3c/svg%3e")}.form-switch .form-check-input:checked{background-position:right center;--bs-form-switch-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.form-switch.form-check-reverse{padding-right:2.5em;padding-left:0}.form-switch.form-check-reverse .form-check-input{margin-right:-2.5em;margin-left:0}.form-check-inline{display:inline-block;margin-right:1rem}.btn-check{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.btn-check:disabled+.btn,.btn-check[disabled]+.btn{pointer-events:none;filter:none;opacity:.65}[data-bs-theme=dark] .form-switch .form-check-input:not(:checked):not(:focus){--bs-form-switch-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.25%29'/%3e%3c/svg%3e")}.form-range{width:100%;height:1.5rem;padding:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent}.form-range:focus{outline:0}.form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range::-moz-focus-outer{border:0}.form-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;-webkit-appearance:none;appearance:none;background-color:#0d6efd;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.form-range::-webkit-slider-thumb:active{background-color:#b6d4fe}.form-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:var(--bs-secondary-bg);border-color:transparent;border-radius:1rem}.form-range::-moz-range-thumb{width:1rem;height:1rem;-moz-appearance:none;appearance:none;background-color:#0d6efd;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-range::-moz-range-thumb{-moz-transition:none;transition:none}}.form-range::-moz-range-thumb:active{background-color:#b6d4fe}.form-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:var(--bs-secondary-bg);border-color:transparent;border-radius:1rem}.form-range:disabled{pointer-events:none}.form-range:disabled::-webkit-slider-thumb{background-color:var(--bs-secondary-color)}.form-range:disabled::-moz-range-thumb{background-color:var(--bs-secondary-color)}.form-floating{position:relative}.form-floating>.form-control,.form-floating>.form-control-plaintext,.form-floating>.form-select{height:calc(3.5rem + calc(var(--bs-border-width) * 2));min-height:calc(3.5rem + calc(var(--bs-border-width) * 2));line-height:1.25}.form-floating>label{position:absolute;top:0;left:0;z-index:2;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:var(--bs-border-width) solid transparent;transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media (prefers-reduced-motion:reduce){.form-floating>label{transition:none}}.form-floating>.form-control,.form-floating>.form-control-plaintext{padding:1rem .75rem}.form-floating>.form-control-plaintext::-moz-placeholder,.form-floating>.form-control::-moz-placeholder{color:transparent}.form-floating>.form-control-plaintext::placeholder,.form-floating>.form-control::placeholder{color:transparent}.form-floating>.form-control-plaintext:not(:-moz-placeholder-shown),.form-floating>.form-control:not(:-moz-placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control-plaintext:focus,.form-floating>.form-control-plaintext:not(:placeholder-shown),.form-floating>.form-control:focus,.form-floating>.form-control:not(:placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control-plaintext:-webkit-autofill,.form-floating>.form-control:-webkit-autofill{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-select{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:not(:-moz-placeholder-shown)~label{color:rgba(var(--bs-body-color-rgb),.65);transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control-plaintext~label,.form-floating>.form-control:focus~label,.form-floating>.form-control:not(:placeholder-shown)~label,.form-floating>.form-select~label{color:rgba(var(--bs-body-color-rgb),.65);transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control:not(:-moz-placeholder-shown)~label::after{position:absolute;inset:1rem 0.375rem;z-index:-1;height:1.5em;content:"";background-color:var(--bs-body-bg);border-radius:var(--bs-border-radius)}.form-floating>.form-control-plaintext~label::after,.form-floating>.form-control:focus~label::after,.form-floating>.form-control:not(:placeholder-shown)~label::after,.form-floating>.form-select~label::after{position:absolute;inset:1rem 0.375rem;z-index:-1;height:1.5em;content:"";background-color:var(--bs-body-bg);border-radius:var(--bs-border-radius)}.form-floating>.form-control:-webkit-autofill~label{color:rgba(var(--bs-body-color-rgb),.65);transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control-plaintext~label{border-width:var(--bs-border-width) 0}.form-floating>.form-control:disabled~label,.form-floating>:disabled~label{color:#6c757d}.form-floating>.form-control:disabled~label::after,.form-floating>:disabled~label::after{background-color:var(--bs-secondary-bg)}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.form-control,.input-group>.form-floating,.input-group>.form-select{position:relative;flex:1 1 auto;width:1%;min-width:0}.input-group>.form-control:focus,.input-group>.form-floating:focus-within,.input-group>.form-select:focus{z-index:5}.input-group .btn{position:relative;z-index:2}.input-group .btn:focus{z-index:5}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:var(--bs-body-color);text-align:center;white-space:nowrap;background-color:var(--bs-tertiary-bg);border:var(--bs-border-width) solid var(--bs-border-color);border-radius:var(--bs-border-radius)}.input-group-lg>.btn,.input-group-lg>.form-control,.input-group-lg>.form-select,.input-group-lg>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.input-group-sm>.btn,.input-group-sm>.form-control,.input-group-sm>.form-select,.input-group-sm>.input-group-text{padding:.25rem .5rem;font-size:.875rem;border-radius:var(--bs-border-radius-sm)}.input-group-lg>.form-select,.input-group-sm>.form-select{padding-right:3rem}.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),.input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,.input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select,.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating){border-top-right-radius:0;border-bottom-right-radius:0}.input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),.input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-control,.input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-select,.input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:calc(var(--bs-border-width) * -1);border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.form-floating:not(:first-child)>.form-control,.input-group>.form-floating:not(:first-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:var(--bs-form-valid-color)}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:var(--bs-success);border-radius:var(--bs-border-radius)}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:var(--bs-form-valid-border-color);padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:var(--bs-form-valid-border-color);box-shadow:0 0 0 .25rem rgba(var(--bs-success-rgb),.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.form-select.is-valid,.was-validated .form-select:valid{border-color:var(--bs-form-valid-border-color)}.form-select.is-valid:not([multiple]):not([size]),.form-select.is-valid:not([multiple])[size="1"],.was-validated .form-select:valid:not([multiple]):not([size]),.was-validated .form-select:valid:not([multiple])[size="1"]{--bs-form-select-bg-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");padding-right:4.125rem;background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem)}.form-select.is-valid:focus,.was-validated .form-select:valid:focus{border-color:var(--bs-form-valid-border-color);box-shadow:0 0 0 .25rem rgba(var(--bs-success-rgb),.25)}.form-control-color.is-valid,.was-validated .form-control-color:valid{width:calc(3rem + calc(1.5em + .75rem))}.form-check-input.is-valid,.was-validated .form-check-input:valid{border-color:var(--bs-form-valid-border-color)}.form-check-input.is-valid:checked,.was-validated .form-check-input:valid:checked{background-color:var(--bs-form-valid-color)}.form-check-input.is-valid:focus,.was-validated .form-check-input:valid:focus{box-shadow:0 0 0 .25rem rgba(var(--bs-success-rgb),.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:var(--bs-form-valid-color)}.form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.input-group>.form-control:not(:focus).is-valid,.input-group>.form-floating:not(:focus-within).is-valid,.input-group>.form-select:not(:focus).is-valid,.was-validated .input-group>.form-control:not(:focus):valid,.was-validated .input-group>.form-floating:not(:focus-within):valid,.was-validated .input-group>.form-select:not(:focus):valid{z-index:3}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:var(--bs-form-invalid-color)}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:var(--bs-danger);border-radius:var(--bs-border-radius)}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:var(--bs-form-invalid-border-color);padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:var(--bs-form-invalid-border-color);box-shadow:0 0 0 .25rem rgba(var(--bs-danger-rgb),.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.form-select.is-invalid,.was-validated .form-select:invalid{border-color:var(--bs-form-invalid-border-color)}.form-select.is-invalid:not([multiple]):not([size]),.form-select.is-invalid:not([multiple])[size="1"],.was-validated .form-select:invalid:not([multiple]):not([size]),.was-validated .form-select:invalid:not([multiple])[size="1"]{--bs-form-select-bg-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");padding-right:4.125rem;background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem)}.form-select.is-invalid:focus,.was-validated .form-select:invalid:focus{border-color:var(--bs-form-invalid-border-color);box-shadow:0 0 0 .25rem rgba(var(--bs-danger-rgb),.25)}.form-control-color.is-invalid,.was-validated .form-control-color:invalid{width:calc(3rem + calc(1.5em + .75rem))}.form-check-input.is-invalid,.was-validated .form-check-input:invalid{border-color:var(--bs-form-invalid-border-color)}.form-check-input.is-invalid:checked,.was-validated .form-check-input:invalid:checked{background-color:var(--bs-form-invalid-color)}.form-check-input.is-invalid:focus,.was-validated .form-check-input:invalid:focus{box-shadow:0 0 0 .25rem rgba(var(--bs-danger-rgb),.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:var(--bs-form-invalid-color)}.form-check-inline .form-check-input~.invalid-feedback{margin-left:.5em}.input-group>.form-control:not(:focus).is-invalid,.input-group>.form-floating:not(:focus-within).is-invalid,.input-group>.form-select:not(:focus).is-invalid,.was-validated .input-group>.form-control:not(:focus):invalid,.was-validated .input-group>.form-floating:not(:focus-within):invalid,.was-validated .input-group>.form-select:not(:focus):invalid{z-index:4}.btn{--bs-btn-padding-x:0.75rem;--bs-btn-padding-y:0.375rem;--bs-btn-font-family: ;--bs-btn-font-size:1rem;--bs-btn-font-weight:400;--bs-btn-line-height:1.5;--bs-btn-color:var(--bs-body-color);--bs-btn-bg:transparent;--bs-btn-border-width:var(--bs-border-width);--bs-btn-border-color:transparent;--bs-btn-border-radius:var(--bs-border-radius);--bs-btn-hover-border-color:transparent;--bs-btn-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.15),0 1px 1px rgba(0, 0, 0, 0.075);--bs-btn-disabled-opacity:0.65;--bs-btn-focus-box-shadow:0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);display:inline-block;padding:var(--bs-btn-padding-y) var(--bs-btn-padding-x);font-family:var(--bs-btn-font-family);font-size:var(--bs-btn-font-size);font-weight:var(--bs-btn-font-weight);line-height:var(--bs-btn-line-height);color:var(--bs-btn-color);text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:var(--bs-btn-border-width) solid var(--bs-btn-border-color);border-radius:var(--bs-btn-border-radius);background-color:var(--bs-btn-bg);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color)}.btn-check+.btn:hover{color:var(--bs-btn-color);background-color:var(--bs-btn-bg);border-color:var(--bs-btn-border-color)}.btn:focus-visible{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:focus-visible+.btn{border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:checked+.btn,.btn.active,.btn.show,.btn:first-child:active,:not(.btn-check)+.btn:active{color:var(--bs-btn-active-color);background-color:var(--bs-btn-active-bg);border-color:var(--bs-btn-active-border-color)}.btn-check:checked+.btn:focus-visible,.btn.active:focus-visible,.btn.show:focus-visible,.btn:first-child:active:focus-visible,:not(.btn-check)+.btn:active:focus-visible{box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:checked:focus-visible+.btn{box-shadow:var(--bs-btn-focus-box-shadow)}.btn.disabled,.btn:disabled,fieldset:disabled .btn{color:var(--bs-btn-disabled-color);pointer-events:none;background-color:var(--bs-btn-disabled-bg);border-color:var(--bs-btn-disabled-border-color);opacity:var(--bs-btn-disabled-opacity)}.btn-primary{--bs-btn-color:#fff;--bs-btn-bg:#0d6efd;--bs-btn-border-color:#0d6efd;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#0b5ed7;--bs-btn-hover-border-color:#0a58ca;--bs-btn-focus-shadow-rgb:49,132,253;--bs-btn-active-color:#fff;--bs-btn-active-bg:#0a58ca;--bs-btn-active-border-color:#0a53be;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#0d6efd;--bs-btn-disabled-border-color:#0d6efd}.btn-secondary{--bs-btn-color:#fff;--bs-btn-bg:#6c757d;--bs-btn-border-color:#6c757d;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#5c636a;--bs-btn-hover-border-color:#565e64;--bs-btn-focus-shadow-rgb:130,138,145;--bs-btn-active-color:#fff;--bs-btn-active-bg:#565e64;--bs-btn-active-border-color:#51585e;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#6c757d;--bs-btn-disabled-border-color:#6c757d}.btn-success{--bs-btn-color:#fff;--bs-btn-bg:#198754;--bs-btn-border-color:#198754;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#157347;--bs-btn-hover-border-color:#146c43;--bs-btn-focus-shadow-rgb:60,153,110;--bs-btn-active-color:#fff;--bs-btn-active-bg:#146c43;--bs-btn-active-border-color:#13653f;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#198754;--bs-btn-disabled-border-color:#198754}.btn-info{--bs-btn-color:#000;--bs-btn-bg:#0dcaf0;--bs-btn-border-color:#0dcaf0;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#31d2f2;--bs-btn-hover-border-color:#25cff2;--bs-btn-focus-shadow-rgb:11,172,204;--bs-btn-active-color:#000;--bs-btn-active-bg:#3dd5f3;--bs-btn-active-border-color:#25cff2;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#000;--bs-btn-disabled-bg:#0dcaf0;--bs-btn-disabled-border-color:#0dcaf0}.btn-warning{--bs-btn-color:#000;--bs-btn-bg:#ffc107;--bs-btn-border-color:#ffc107;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#ffca2c;--bs-btn-hover-border-color:#ffc720;--bs-btn-focus-shadow-rgb:217,164,6;--bs-btn-active-color:#000;--bs-btn-active-bg:#ffcd39;--bs-btn-active-border-color:#ffc720;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#000;--bs-btn-disabled-bg:#ffc107;--bs-btn-disabled-border-color:#ffc107}.btn-danger{--bs-btn-color:#fff;--bs-btn-bg:#dc3545;--bs-btn-border-color:#dc3545;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#bb2d3b;--bs-btn-hover-border-color:#b02a37;--bs-btn-focus-shadow-rgb:225,83,97;--bs-btn-active-color:#fff;--bs-btn-active-bg:#b02a37;--bs-btn-active-border-color:#a52834;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#dc3545;--bs-btn-disabled-border-color:#dc3545}.btn-light{--bs-btn-color:#000;--bs-btn-bg:#f8f9fa;--bs-btn-border-color:#f8f9fa;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#d3d4d5;--bs-btn-hover-border-color:#c6c7c8;--bs-btn-focus-shadow-rgb:211,212,213;--bs-btn-active-color:#000;--bs-btn-active-bg:#c6c7c8;--bs-btn-active-border-color:#babbbc;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#000;--bs-btn-disabled-bg:#f8f9fa;--bs-btn-disabled-border-color:#f8f9fa}.btn-dark{--bs-btn-color:#fff;--bs-btn-bg:#212529;--bs-btn-border-color:#212529;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#424649;--bs-btn-hover-border-color:#373b3e;--bs-btn-focus-shadow-rgb:66,70,73;--bs-btn-active-color:#fff;--bs-btn-active-bg:#4d5154;--bs-btn-active-border-color:#373b3e;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#212529;--bs-btn-disabled-border-color:#212529}.btn-outline-primary{--bs-btn-color:#0d6efd;--bs-btn-border-color:#0d6efd;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#0d6efd;--bs-btn-hover-border-color:#0d6efd;--bs-btn-focus-shadow-rgb:13,110,253;--bs-btn-active-color:#fff;--bs-btn-active-bg:#0d6efd;--bs-btn-active-border-color:#0d6efd;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#0d6efd;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#0d6efd;--bs-gradient:none}.btn-outline-secondary{--bs-btn-color:#6c757d;--bs-btn-border-color:#6c757d;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#6c757d;--bs-btn-hover-border-color:#6c757d;--bs-btn-focus-shadow-rgb:108,117,125;--bs-btn-active-color:#fff;--bs-btn-active-bg:#6c757d;--bs-btn-active-border-color:#6c757d;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#6c757d;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#6c757d;--bs-gradient:none}.btn-outline-success{--bs-btn-color:#198754;--bs-btn-border-color:#198754;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#198754;--bs-btn-hover-border-color:#198754;--bs-btn-focus-shadow-rgb:25,135,84;--bs-btn-active-color:#fff;--bs-btn-active-bg:#198754;--bs-btn-active-border-color:#198754;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#198754;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#198754;--bs-gradient:none}.btn-outline-info{--bs-btn-color:#0dcaf0;--bs-btn-border-color:#0dcaf0;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#0dcaf0;--bs-btn-hover-border-color:#0dcaf0;--bs-btn-focus-shadow-rgb:13,202,240;--bs-btn-active-color:#000;--bs-btn-active-bg:#0dcaf0;--bs-btn-active-border-color:#0dcaf0;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#0dcaf0;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#0dcaf0;--bs-gradient:none}.btn-outline-warning{--bs-btn-color:#ffc107;--bs-btn-border-color:#ffc107;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#ffc107;--bs-btn-hover-border-color:#ffc107;--bs-btn-focus-shadow-rgb:255,193,7;--bs-btn-active-color:#000;--bs-btn-active-bg:#ffc107;--bs-btn-active-border-color:#ffc107;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#ffc107;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#ffc107;--bs-gradient:none}.btn-outline-danger{--bs-btn-color:#dc3545;--bs-btn-border-color:#dc3545;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#dc3545;--bs-btn-hover-border-color:#dc3545;--bs-btn-focus-shadow-rgb:220,53,69;--bs-btn-active-color:#fff;--bs-btn-active-bg:#dc3545;--bs-btn-active-border-color:#dc3545;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#dc3545;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#dc3545;--bs-gradient:none}.btn-outline-light{--bs-btn-color:#f8f9fa;--bs-btn-border-color:#f8f9fa;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#f8f9fa;--bs-btn-hover-border-color:#f8f9fa;--bs-btn-focus-shadow-rgb:248,249,250;--bs-btn-active-color:#000;--bs-btn-active-bg:#f8f9fa;--bs-btn-active-border-color:#f8f9fa;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#f8f9fa;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#f8f9fa;--bs-gradient:none}.btn-outline-dark{--bs-btn-color:#212529;--bs-btn-border-color:#212529;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#212529;--bs-btn-hover-border-color:#212529;--bs-btn-focus-shadow-rgb:33,37,41;--bs-btn-active-color:#fff;--bs-btn-active-bg:#212529;--bs-btn-active-border-color:#212529;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#212529;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#212529;--bs-gradient:none}.btn-link{--bs-btn-font-weight:400;--bs-btn-color:var(--bs-link-color);--bs-btn-bg:transparent;--bs-btn-border-color:transparent;--bs-btn-hover-color:var(--bs-link-hover-color);--bs-btn-hover-border-color:transparent;--bs-btn-active-color:var(--bs-link-hover-color);--bs-btn-active-border-color:transparent;--bs-btn-disabled-color:#6c757d;--bs-btn-disabled-border-color:transparent;--bs-btn-box-shadow:0 0 0 #000;--bs-btn-focus-shadow-rgb:49,132,253;text-decoration:underline}.btn-link:focus-visible{color:var(--bs-btn-color)}.btn-link:hover{color:var(--bs-btn-hover-color)}.btn-group-lg>.btn,.btn-lg{--bs-btn-padding-y:0.5rem;--bs-btn-padding-x:1rem;--bs-btn-font-size:1.25rem;--bs-btn-border-radius:var(--bs-border-radius-lg)}.btn-group-sm>.btn,.btn-sm{--bs-btn-padding-y:0.25rem;--bs-btn-padding-x:0.5rem;--bs-btn-font-size:0.875rem;--bs-btn-border-radius:var(--bs-border-radius-sm)}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.collapsing.collapse-horizontal{width:0;height:auto;transition:width .35s ease}@media (prefers-reduced-motion:reduce){.collapsing.collapse-horizontal{transition:none}}.dropdown,.dropdown-center,.dropend,.dropstart,.dropup,.dropup-center{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{--bs-dropdown-zindex:1000;--bs-dropdown-min-width:10rem;--bs-dropdown-padding-x:0;--bs-dropdown-padding-y:0.5rem;--bs-dropdown-spacer:0.125rem;--bs-dropdown-font-size:1rem;--bs-dropdown-color:var(--bs-body-color);--bs-dropdown-bg:var(--bs-body-bg);--bs-dropdown-border-color:var(--bs-border-color-translucent);--bs-dropdown-border-radius:var(--bs-border-radius);--bs-dropdown-border-width:var(--bs-border-width);--bs-dropdown-inner-border-radius:calc(var(--bs-border-radius) - var(--bs-border-width));--bs-dropdown-divider-bg:var(--bs-border-color-translucent);--bs-dropdown-divider-margin-y:0.5rem;--bs-dropdown-box-shadow:var(--bs-box-shadow);--bs-dropdown-link-color:var(--bs-body-color);--bs-dropdown-link-hover-color:var(--bs-body-color);--bs-dropdown-link-hover-bg:var(--bs-tertiary-bg);--bs-dropdown-link-active-color:#fff;--bs-dropdown-link-active-bg:#0d6efd;--bs-dropdown-link-disabled-color:var(--bs-tertiary-color);--bs-dropdown-item-padding-x:1rem;--bs-dropdown-item-padding-y:0.25rem;--bs-dropdown-header-color:#6c757d;--bs-dropdown-header-padding-x:1rem;--bs-dropdown-header-padding-y:0.5rem;position:absolute;z-index:var(--bs-dropdown-zindex);display:none;min-width:var(--bs-dropdown-min-width);padding:var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);margin:0;font-size:var(--bs-dropdown-font-size);color:var(--bs-dropdown-color);text-align:left;list-style:none;background-color:var(--bs-dropdown-bg);background-clip:padding-box;border:var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);border-radius:var(--bs-dropdown-border-radius)}.dropdown-menu[data-bs-popper]{top:100%;left:0;margin-top:var(--bs-dropdown-spacer)}.dropdown-menu-start{--bs-position:start}.dropdown-menu-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-end{--bs-position:end}.dropdown-menu-end[data-bs-popper]{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-start{--bs-position:start}.dropdown-menu-sm-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-sm-end{--bs-position:end}.dropdown-menu-sm-end[data-bs-popper]{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-start{--bs-position:start}.dropdown-menu-md-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-md-end{--bs-position:end}.dropdown-menu-md-end[data-bs-popper]{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-start{--bs-position:start}.dropdown-menu-lg-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-lg-end{--bs-position:end}.dropdown-menu-lg-end[data-bs-popper]{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-start{--bs-position:start}.dropdown-menu-xl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xl-end{--bs-position:end}.dropdown-menu-xl-end[data-bs-popper]{right:0;left:auto}}@media (min-width:1400px){.dropdown-menu-xxl-start{--bs-position:start}.dropdown-menu-xxl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xxl-end{--bs-position:end}.dropdown-menu-xxl-end[data-bs-popper]{right:0;left:auto}}.dropup .dropdown-menu[data-bs-popper]{top:auto;bottom:100%;margin-top:0;margin-bottom:var(--bs-dropdown-spacer)}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-menu[data-bs-popper]{top:0;right:auto;left:100%;margin-top:0;margin-left:var(--bs-dropdown-spacer)}.dropend .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropend .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-toggle::after{vertical-align:0}.dropstart .dropdown-menu[data-bs-popper]{top:0;right:100%;left:auto;margin-top:0;margin-right:var(--bs-dropdown-spacer)}.dropstart .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropstart .dropdown-toggle::after{display:none}.dropstart .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropstart .dropdown-toggle:empty::after{margin-left:0}.dropstart .dropdown-toggle::before{vertical-align:0}.dropdown-divider{height:0;margin:var(--bs-dropdown-divider-margin-y) 0;overflow:hidden;border-top:1px solid var(--bs-dropdown-divider-bg);opacity:1}.dropdown-item{display:block;width:100%;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);clear:both;font-weight:400;color:var(--bs-dropdown-link-color);text-align:inherit;text-decoration:none;white-space:nowrap;background-color:transparent;border:0;border-radius:var(--bs-dropdown-item-border-radius,0)}.dropdown-item:focus,.dropdown-item:hover{color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}.dropdown-item.active,.dropdown-item:active{color:var(--bs-dropdown-link-active-color);text-decoration:none;background-color:var(--bs-dropdown-link-active-bg)}.dropdown-item.disabled,.dropdown-item:disabled{color:var(--bs-dropdown-link-disabled-color);pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);margin-bottom:0;font-size:.875rem;color:var(--bs-dropdown-header-color);white-space:nowrap}.dropdown-item-text{display:block;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);color:var(--bs-dropdown-link-color)}.dropdown-menu-dark{--bs-dropdown-color:#dee2e6;--bs-dropdown-bg:#343a40;--bs-dropdown-border-color:var(--bs-border-color-translucent);--bs-dropdown-box-shadow: ;--bs-dropdown-link-color:#dee2e6;--bs-dropdown-link-hover-color:#fff;--bs-dropdown-divider-bg:var(--bs-border-color-translucent);--bs-dropdown-link-hover-bg:rgba(255, 255, 255, 0.15);--bs-dropdown-link-active-color:#fff;--bs-dropdown-link-active-bg:#0d6efd;--bs-dropdown-link-disabled-color:#adb5bd;--bs-dropdown-header-color:#adb5bd}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn-check:checked+.btn,.btn-group-vertical>.btn-check:focus+.btn,.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn-check:checked+.btn,.btn-group>.btn-check:focus+.btn,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group{border-radius:var(--bs-border-radius)}.btn-group>.btn-group:not(:first-child),.btn-group>:not(.btn-check:first-child)+.btn{margin-left:calc(var(--bs-border-width) * -1)}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn.dropdown-toggle-split:first-child,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:nth-child(n+3),.btn-group>:not(.btn-check)+.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropend .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropstart .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:calc(var(--bs-border-width) * -1)}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn~.btn{border-top-left-radius:0;border-top-right-radius:0}.nav{--bs-nav-link-padding-x:1rem;--bs-nav-link-padding-y:0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color:var(--bs-link-color);--bs-nav-link-hover-color:var(--bs-link-hover-color);--bs-nav-link-disabled-color:var(--bs-secondary-color);display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);font-size:var(--bs-nav-link-font-size);font-weight:var(--bs-nav-link-font-weight);color:var(--bs-nav-link-color);text-decoration:none;background:0 0;border:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media (prefers-reduced-motion:reduce){.nav-link{transition:none}}.nav-link:focus,.nav-link:hover{color:var(--bs-nav-link-hover-color)}.nav-link:focus-visible{outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.nav-link.disabled,.nav-link:disabled{color:var(--bs-nav-link-disabled-color);pointer-events:none;cursor:default}.nav-tabs{--bs-nav-tabs-border-width:var(--bs-border-width);--bs-nav-tabs-border-color:var(--bs-border-color);--bs-nav-tabs-border-radius:var(--bs-border-radius);--bs-nav-tabs-link-hover-border-color:var(--bs-secondary-bg) var(--bs-secondary-bg) var(--bs-border-color);--bs-nav-tabs-link-active-color:var(--bs-emphasis-color);--bs-nav-tabs-link-active-bg:var(--bs-body-bg);--bs-nav-tabs-link-active-border-color:var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.nav-tabs .nav-link{margin-bottom:calc(-1 * var(--bs-nav-tabs-border-width));border:var(--bs-nav-tabs-border-width) solid transparent;border-top-left-radius:var(--bs-nav-tabs-border-radius);border-top-right-radius:var(--bs-nav-tabs-border-radius)}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{isolation:isolate;border-color:var(--bs-nav-tabs-link-hover-border-color)}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:var(--bs-nav-tabs-link-active-color);background-color:var(--bs-nav-tabs-link-active-bg);border-color:var(--bs-nav-tabs-link-active-border-color)}.nav-tabs .dropdown-menu{margin-top:calc(-1 * var(--bs-nav-tabs-border-width));border-top-left-radius:0;border-top-right-radius:0}.nav-pills{--bs-nav-pills-border-radius:var(--bs-border-radius);--bs-nav-pills-link-active-color:#fff;--bs-nav-pills-link-active-bg:#0d6efd}.nav-pills .nav-link{border-radius:var(--bs-nav-pills-border-radius)}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:var(--bs-nav-pills-link-active-color);background-color:var(--bs-nav-pills-link-active-bg)}.nav-underline{--bs-nav-underline-gap:1rem;--bs-nav-underline-border-width:0.125rem;--bs-nav-underline-link-active-color:var(--bs-emphasis-color);gap:var(--bs-nav-underline-gap)}.nav-underline .nav-link{padding-right:0;padding-left:0;border-bottom:var(--bs-nav-underline-border-width) solid transparent}.nav-underline .nav-link:focus,.nav-underline .nav-link:hover{border-bottom-color:currentcolor}.nav-underline .nav-link.active,.nav-underline .show>.nav-link{font-weight:700;color:var(--bs-nav-underline-link-active-color);border-bottom-color:currentcolor}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{--bs-navbar-padding-x:0;--bs-navbar-padding-y:0.5rem;--bs-navbar-color:rgba(var(--bs-emphasis-color-rgb), 0.65);--bs-navbar-hover-color:rgba(var(--bs-emphasis-color-rgb), 0.8);--bs-navbar-disabled-color:rgba(var(--bs-emphasis-color-rgb), 0.3);--bs-navbar-active-color:rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-brand-padding-y:0.3125rem;--bs-navbar-brand-margin-end:1rem;--bs-navbar-brand-font-size:1.25rem;--bs-navbar-brand-color:rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-brand-hover-color:rgba(var(--bs-emphasis-color-rgb), 1);--bs-navbar-nav-link-padding-x:0.5rem;--bs-navbar-toggler-padding-y:0.25rem;--bs-navbar-toggler-padding-x:0.75rem;--bs-navbar-toggler-font-size:1.25rem;--bs-navbar-toggler-icon-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");--bs-navbar-toggler-border-color:rgba(var(--bs-emphasis-color-rgb), 0.15);--bs-navbar-toggler-border-radius:var(--bs-border-radius);--bs-navbar-toggler-focus-width:0.25rem;--bs-navbar-toggler-transition:box-shadow 0.15s ease-in-out;position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:var(--bs-navbar-padding-y) var(--bs-navbar-padding-x)}.navbar>.container,.navbar>.container-fluid,.navbar>.container-lg,.navbar>.container-md,.navbar>.container-sm,.navbar>.container-xl,.navbar>.container-xxl{display:flex;flex-wrap:inherit;align-items:center;justify-content:space-between}.navbar-brand{padding-top:var(--bs-navbar-brand-padding-y);padding-bottom:var(--bs-navbar-brand-padding-y);margin-right:var(--bs-navbar-brand-margin-end);font-size:var(--bs-navbar-brand-font-size);color:var(--bs-navbar-brand-color);text-decoration:none;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{color:var(--bs-navbar-brand-hover-color)}.navbar-nav{--bs-nav-link-padding-x:0;--bs-nav-link-padding-y:0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color:var(--bs-navbar-color);--bs-nav-link-hover-color:var(--bs-navbar-hover-color);--bs-nav-link-disabled-color:var(--bs-navbar-disabled-color);display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link.active,.navbar-nav .nav-link.show{color:var(--bs-navbar-active-color)}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-navbar-color)}.navbar-text a,.navbar-text a:focus,.navbar-text a:hover{color:var(--bs-navbar-active-color)}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:var(--bs-navbar-toggler-padding-y) var(--bs-navbar-toggler-padding-x);font-size:var(--bs-navbar-toggler-font-size);line-height:1;color:var(--bs-navbar-color);background-color:transparent;border:var(--bs-border-width) solid var(--bs-navbar-toggler-border-color);border-radius:var(--bs-navbar-toggler-border-radius);transition:var(--bs-navbar-toggler-transition)}@media (prefers-reduced-motion:reduce){.navbar-toggler{transition:none}}.navbar-toggler:hover{text-decoration:none}.navbar-toggler:focus{text-decoration:none;outline:0;box-shadow:0 0 0 var(--bs-navbar-toggler-focus-width)}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-image:var(--bs-navbar-toggler-icon-bg);background-repeat:no-repeat;background-position:center;background-size:100%}.navbar-nav-scroll{max-height:var(--bs-scroll-height,75vh);overflow-y:auto}@media (min-width:576px){.navbar-expand-sm{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-sm .offcanvas .offcanvas-header{display:none}.navbar-expand-sm .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:768px){.navbar-expand-md{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-md .offcanvas .offcanvas-header{display:none}.navbar-expand-md .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:992px){.navbar-expand-lg{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-lg .offcanvas .offcanvas-header{display:none}.navbar-expand-lg .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:1200px){.navbar-expand-xl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xl .offcanvas .offcanvas-header{display:none}.navbar-expand-xl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:1400px){.navbar-expand-xxl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}.navbar-expand-xxl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xxl .offcanvas .offcanvas-header{display:none}.navbar-expand-xxl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}.navbar-expand{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand .offcanvas .offcanvas-header{display:none}.navbar-expand .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}.navbar-dark,.navbar[data-bs-theme=dark]{--bs-navbar-color:rgba(255, 255, 255, 0.55);--bs-navbar-hover-color:rgba(255, 255, 255, 0.75);--bs-navbar-disabled-color:rgba(255, 255, 255, 0.25);--bs-navbar-active-color:#fff;--bs-navbar-brand-color:#fff;--bs-navbar-brand-hover-color:#fff;--bs-navbar-toggler-border-color:rgba(255, 255, 255, 0.1);--bs-navbar-toggler-icon-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}[data-bs-theme=dark] .navbar-toggler-icon{--bs-navbar-toggler-icon-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.card{--bs-card-spacer-y:1rem;--bs-card-spacer-x:1rem;--bs-card-title-spacer-y:0.5rem;--bs-card-title-color: ;--bs-card-subtitle-color: ;--bs-card-border-width:var(--bs-border-width);--bs-card-border-color:var(--bs-border-color-translucent);--bs-card-border-radius:var(--bs-border-radius);--bs-card-box-shadow: ;--bs-card-inner-border-radius:calc(var(--bs-border-radius) - (var(--bs-border-width)));--bs-card-cap-padding-y:0.5rem;--bs-card-cap-padding-x:1rem;--bs-card-cap-bg:rgba(var(--bs-body-color-rgb), 0.03);--bs-card-cap-color: ;--bs-card-height: ;--bs-card-color: ;--bs-card-bg:var(--bs-body-bg);--bs-card-img-overlay-padding:1rem;--bs-card-group-margin:0.75rem;position:relative;display:flex;flex-direction:column;min-width:0;height:var(--bs-card-height);color:var(--bs-body-color);word-wrap:break-word;background-color:var(--bs-card-bg);background-clip:border-box;border:var(--bs-card-border-width) solid var(--bs-card-border-color);border-radius:var(--bs-card-border-radius)}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;padding:var(--bs-card-spacer-y) var(--bs-card-spacer-x);color:var(--bs-card-color)}.card-title{margin-bottom:var(--bs-card-title-spacer-y);color:var(--bs-card-title-color)}.card-subtitle{margin-top:calc(-.5 * var(--bs-card-title-spacer-y));margin-bottom:0;color:var(--bs-card-subtitle-color)}.card-text:last-child{margin-bottom:0}.card-link+.card-link{margin-left:var(--bs-card-spacer-x)}.card-header{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);margin-bottom:0;color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-bottom:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-header:first-child{border-radius:var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0}.card-footer{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-top:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-footer:last-child{border-radius:0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius)}.card-header-tabs{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-bottom:calc(-1 * var(--bs-card-cap-padding-y));margin-left:calc(-.5 * var(--bs-card-cap-padding-x));border-bottom:0}.card-header-tabs .nav-link.active{background-color:var(--bs-card-bg);border-bottom-color:var(--bs-card-bg)}.card-header-pills{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-left:calc(-.5 * var(--bs-card-cap-padding-x))}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:var(--bs-card-img-overlay-padding);border-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom,.card-img-top{width:100%}.card-img,.card-img-top{border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom{border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card-group>.card{margin-bottom:var(--bs-card-group-margin)}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.accordion{--bs-accordion-color:var(--bs-body-color);--bs-accordion-bg:var(--bs-body-bg);--bs-accordion-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out,border-radius 0.15s ease;--bs-accordion-border-color:var(--bs-border-color);--bs-accordion-border-width:var(--bs-border-width);--bs-accordion-border-radius:var(--bs-border-radius);--bs-accordion-inner-border-radius:calc(var(--bs-border-radius) - (var(--bs-border-width)));--bs-accordion-btn-padding-x:1.25rem;--bs-accordion-btn-padding-y:1rem;--bs-accordion-btn-color:var(--bs-body-color);--bs-accordion-btn-bg:var(--bs-accordion-bg);--bs-accordion-btn-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23212529' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");--bs-accordion-btn-icon-width:1.25rem;--bs-accordion-btn-icon-transform:rotate(-180deg);--bs-accordion-btn-icon-transition:transform 0.2s ease-in-out;--bs-accordion-btn-active-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23052c65' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");--bs-accordion-btn-focus-box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-accordion-body-padding-x:1.25rem;--bs-accordion-body-padding-y:1rem;--bs-accordion-active-color:var(--bs-primary-text-emphasis);--bs-accordion-active-bg:var(--bs-primary-bg-subtle)}.accordion-button{position:relative;display:flex;align-items:center;width:100%;padding:var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);font-size:1rem;color:var(--bs-accordion-btn-color);text-align:left;background-color:var(--bs-accordion-btn-bg);border:0;border-radius:0;overflow-anchor:none;transition:var(--bs-accordion-transition)}@media (prefers-reduced-motion:reduce){.accordion-button{transition:none}}.accordion-button:not(.collapsed){color:var(--bs-accordion-active-color);background-color:var(--bs-accordion-active-bg);box-shadow:inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color)}.accordion-button:not(.collapsed)::after{background-image:var(--bs-accordion-btn-active-icon);transform:var(--bs-accordion-btn-icon-transform)}.accordion-button::after{flex-shrink:0;width:var(--bs-accordion-btn-icon-width);height:var(--bs-accordion-btn-icon-width);margin-left:auto;content:"";background-image:var(--bs-accordion-btn-icon);background-repeat:no-repeat;background-size:var(--bs-accordion-btn-icon-width);transition:var(--bs-accordion-btn-icon-transition)}@media (prefers-reduced-motion:reduce){.accordion-button::after{transition:none}}.accordion-button:hover{z-index:2}.accordion-button:focus{z-index:3;outline:0;box-shadow:var(--bs-accordion-btn-focus-box-shadow)}.accordion-header{margin-bottom:0}.accordion-item{color:var(--bs-accordion-color);background-color:var(--bs-accordion-bg);border:var(--bs-accordion-border-width) solid var(--bs-accordion-border-color)}.accordion-item:first-of-type{border-top-left-radius:var(--bs-accordion-border-radius);border-top-right-radius:var(--bs-accordion-border-radius)}.accordion-item:first-of-type>.accordion-header .accordion-button{border-top-left-radius:var(--bs-accordion-inner-border-radius);border-top-right-radius:var(--bs-accordion-inner-border-radius)}.accordion-item:not(:first-of-type){border-top:0}.accordion-item:last-of-type{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}.accordion-item:last-of-type>.accordion-header .accordion-button.collapsed{border-bottom-right-radius:var(--bs-accordion-inner-border-radius);border-bottom-left-radius:var(--bs-accordion-inner-border-radius)}.accordion-item:last-of-type>.accordion-collapse{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}.accordion-body{padding:var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x)}.accordion-flush>.accordion-item{border-right:0;border-left:0;border-radius:0}.accordion-flush>.accordion-item:first-child{border-top:0}.accordion-flush>.accordion-item:last-child{border-bottom:0}.accordion-flush>.accordion-item>.accordion-header .accordion-button,.accordion-flush>.accordion-item>.accordion-header .accordion-button.collapsed{border-radius:0}.accordion-flush>.accordion-item>.accordion-collapse{border-radius:0}[data-bs-theme=dark] .accordion-button::after{--bs-accordion-btn-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");--bs-accordion-btn-active-icon:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236ea8fe'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.breadcrumb{--bs-breadcrumb-padding-x:0;--bs-breadcrumb-padding-y:0;--bs-breadcrumb-margin-bottom:1rem;--bs-breadcrumb-bg: ;--bs-breadcrumb-border-radius: ;--bs-breadcrumb-divider-color:var(--bs-secondary-color);--bs-breadcrumb-item-padding-x:0.5rem;--bs-breadcrumb-item-active-color:var(--bs-secondary-color);display:flex;flex-wrap:wrap;padding:var(--bs-breadcrumb-padding-y) var(--bs-breadcrumb-padding-x);margin-bottom:var(--bs-breadcrumb-margin-bottom);font-size:var(--bs-breadcrumb-font-size);list-style:none;background-color:var(--bs-breadcrumb-bg);border-radius:var(--bs-breadcrumb-border-radius)}.breadcrumb-item+.breadcrumb-item{padding-left:var(--bs-breadcrumb-item-padding-x)}.breadcrumb-item+.breadcrumb-item::before{float:left;padding-right:var(--bs-breadcrumb-item-padding-x);color:var(--bs-breadcrumb-divider-color);content:var(--bs-breadcrumb-divider, "/")}.breadcrumb-item.active{color:var(--bs-breadcrumb-item-active-color)}.pagination{--bs-pagination-padding-x:0.75rem;--bs-pagination-padding-y:0.375rem;--bs-pagination-font-size:1rem;--bs-pagination-color:var(--bs-link-color);--bs-pagination-bg:var(--bs-body-bg);--bs-pagination-border-width:var(--bs-border-width);--bs-pagination-border-color:var(--bs-border-color);--bs-pagination-border-radius:var(--bs-border-radius);--bs-pagination-hover-color:var(--bs-link-hover-color);--bs-pagination-hover-bg:var(--bs-tertiary-bg);--bs-pagination-hover-border-color:var(--bs-border-color);--bs-pagination-focus-color:var(--bs-link-hover-color);--bs-pagination-focus-bg:var(--bs-secondary-bg);--bs-pagination-focus-box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-pagination-active-color:#fff;--bs-pagination-active-bg:#0d6efd;--bs-pagination-active-border-color:#0d6efd;--bs-pagination-disabled-color:var(--bs-secondary-color);--bs-pagination-disabled-bg:var(--bs-secondary-bg);--bs-pagination-disabled-border-color:var(--bs-border-color);display:flex;padding-left:0;list-style:none}.page-link{position:relative;display:block;padding:var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);font-size:var(--bs-pagination-font-size);color:var(--bs-pagination-color);text-decoration:none;background-color:var(--bs-pagination-bg);border:var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.page-link{transition:none}}.page-link:hover{z-index:2;color:var(--bs-pagination-hover-color);background-color:var(--bs-pagination-hover-bg);border-color:var(--bs-pagination-hover-border-color)}.page-link:focus{z-index:3;color:var(--bs-pagination-focus-color);background-color:var(--bs-pagination-focus-bg);outline:0;box-shadow:var(--bs-pagination-focus-box-shadow)}.active>.page-link,.page-link.active{z-index:3;color:var(--bs-pagination-active-color);background-color:var(--bs-pagination-active-bg);border-color:var(--bs-pagination-active-border-color)}.disabled>.page-link,.page-link.disabled{color:var(--bs-pagination-disabled-color);pointer-events:none;background-color:var(--bs-pagination-disabled-bg);border-color:var(--bs-pagination-disabled-border-color)}.page-item:not(:first-child) .page-link{margin-left:calc(var(--bs-border-width) * -1)}.page-item:first-child .page-link{border-top-left-radius:var(--bs-pagination-border-radius);border-bottom-left-radius:var(--bs-pagination-border-radius)}.page-item:last-child .page-link{border-top-right-radius:var(--bs-pagination-border-radius);border-bottom-right-radius:var(--bs-pagination-border-radius)}.pagination-lg{--bs-pagination-padding-x:1.5rem;--bs-pagination-padding-y:0.75rem;--bs-pagination-font-size:1.25rem;--bs-pagination-border-radius:var(--bs-border-radius-lg)}.pagination-sm{--bs-pagination-padding-x:0.5rem;--bs-pagination-padding-y:0.25rem;--bs-pagination-font-size:0.875rem;--bs-pagination-border-radius:var(--bs-border-radius-sm)}.badge{--bs-badge-padding-x:0.65em;--bs-badge-padding-y:0.35em;--bs-badge-font-size:0.75em;--bs-badge-font-weight:700;--bs-badge-color:#fff;--bs-badge-border-radius:var(--bs-border-radius);display:inline-block;padding:var(--bs-badge-padding-y) var(--bs-badge-padding-x);font-size:var(--bs-badge-font-size);font-weight:var(--bs-badge-font-weight);line-height:1;color:var(--bs-badge-color);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:var(--bs-badge-border-radius)}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.alert{--bs-alert-bg:transparent;--bs-alert-padding-x:1rem;--bs-alert-padding-y:1rem;--bs-alert-margin-bottom:1rem;--bs-alert-color:inherit;--bs-alert-border-color:transparent;--bs-alert-border:var(--bs-border-width) solid var(--bs-alert-border-color);--bs-alert-border-radius:var(--bs-border-radius);--bs-alert-link-color:inherit;position:relative;padding:var(--bs-alert-padding-y) var(--bs-alert-padding-x);margin-bottom:var(--bs-alert-margin-bottom);color:var(--bs-alert-color);background-color:var(--bs-alert-bg);border:var(--bs-alert-border);border-radius:var(--bs-alert-border-radius)}.alert-heading{color:inherit}.alert-link{font-weight:700;color:var(--bs-alert-link-color)}.alert-dismissible{padding-right:3rem}.alert-dismissible .btn-close{position:absolute;top:0;right:0;z-index:2;padding:1.25rem 1rem}.alert-primary{--bs-alert-color:var(--bs-primary-text-emphasis);--bs-alert-bg:var(--bs-primary-bg-subtle);--bs-alert-border-color:var(--bs-primary-border-subtle);--bs-alert-link-color:var(--bs-primary-text-emphasis)}.alert-secondary{--bs-alert-color:var(--bs-secondary-text-emphasis);--bs-alert-bg:var(--bs-secondary-bg-subtle);--bs-alert-border-color:var(--bs-secondary-border-subtle);--bs-alert-link-color:var(--bs-secondary-text-emphasis)}.alert-success{--bs-alert-color:var(--bs-success-text-emphasis);--bs-alert-bg:var(--bs-success-bg-subtle);--bs-alert-border-color:var(--bs-success-border-subtle);--bs-alert-link-color:var(--bs-success-text-emphasis)}.alert-info{--bs-alert-color:var(--bs-info-text-emphasis);--bs-alert-bg:var(--bs-info-bg-subtle);--bs-alert-border-color:var(--bs-info-border-subtle);--bs-alert-link-color:var(--bs-info-text-emphasis)}.alert-warning{--bs-alert-color:var(--bs-warning-text-emphasis);--bs-alert-bg:var(--bs-warning-bg-subtle);--bs-alert-border-color:var(--bs-warning-border-subtle);--bs-alert-link-color:var(--bs-warning-text-emphasis)}.alert-danger{--bs-alert-color:var(--bs-danger-text-emphasis);--bs-alert-bg:var(--bs-danger-bg-subtle);--bs-alert-border-color:var(--bs-danger-border-subtle);--bs-alert-link-color:var(--bs-danger-text-emphasis)}.alert-light{--bs-alert-color:var(--bs-light-text-emphasis);--bs-alert-bg:var(--bs-light-bg-subtle);--bs-alert-border-color:var(--bs-light-border-subtle);--bs-alert-link-color:var(--bs-light-text-emphasis)}.alert-dark{--bs-alert-color:var(--bs-dark-text-emphasis);--bs-alert-bg:var(--bs-dark-bg-subtle);--bs-alert-border-color:var(--bs-dark-border-subtle);--bs-alert-link-color:var(--bs-dark-text-emphasis)}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress,.progress-stacked{--bs-progress-height:1rem;--bs-progress-font-size:0.75rem;--bs-progress-bg:var(--bs-secondary-bg);--bs-progress-border-radius:var(--bs-border-radius);--bs-progress-box-shadow:var(--bs-box-shadow-inset);--bs-progress-bar-color:#fff;--bs-progress-bar-bg:#0d6efd;--bs-progress-bar-transition:width 0.6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}.progress-stacked>.progress{overflow:visible}.progress-stacked>.progress>.progress-bar{width:100%}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.list-group{--bs-list-group-color:var(--bs-body-color);--bs-list-group-bg:var(--bs-body-bg);--bs-list-group-border-color:var(--bs-border-color);--bs-list-group-border-width:var(--bs-border-width);--bs-list-group-border-radius:var(--bs-border-radius);--bs-list-group-item-padding-x:1rem;--bs-list-group-item-padding-y:0.5rem;--bs-list-group-action-color:var(--bs-secondary-color);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-tertiary-bg);--bs-list-group-action-active-color:var(--bs-body-color);--bs-list-group-action-active-bg:var(--bs-secondary-bg);--bs-list-group-disabled-color:var(--bs-secondary-color);--bs-list-group-disabled-bg:var(--bs-body-bg);--bs-list-group-active-color:#fff;--bs-list-group-active-bg:#0d6efd;--bs-list-group-active-border-color:#0d6efd;display:flex;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:var(--bs-list-group-border-radius)}.list-group-numbered{list-style-type:none;counter-reset:section}.list-group-numbered>.list-group-item::before{content:counters(section, ".") ". ";counter-increment:section}.list-group-item-action{width:100%;color:var(--bs-list-group-action-color);text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:var(--bs-list-group-action-hover-color);text-decoration:none;background-color:var(--bs-list-group-action-hover-bg)}.list-group-item-action:active{color:var(--bs-list-group-action-active-color);background-color:var(--bs-list-group-action-active-bg)}.list-group-item{position:relative;display:block;padding:var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);color:var(--bs-list-group-color);text-decoration:none;background-color:var(--bs-list-group-bg);border:var(--bs-list-group-border-width) solid var(--bs-list-group-border-color)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:var(--bs-list-group-disabled-color);pointer-events:none;background-color:var(--bs-list-group-disabled-bg)}.list-group-item.active{z-index:2;color:var(--bs-list-group-active-color);background-color:var(--bs-list-group-active-bg);border-color:var(--bs-list-group-active-border-color)}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:calc(-1 * var(--bs-list-group-border-width));border-top-width:var(--bs-list-group-border-width)}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}@media (min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:1400px){.list-group-horizontal-xxl{flex-direction:row}.list-group-horizontal-xxl>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-xxl>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-xxl>.list-group-item.active{margin-top:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 var(--bs-list-group-border-width)}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{--bs-list-group-color:var(--bs-primary-text-emphasis);--bs-list-group-bg:var(--bs-primary-bg-subtle);--bs-list-group-border-color:var(--bs-primary-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-primary-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-primary-border-subtle);--bs-list-group-active-color:var(--bs-primary-bg-subtle);--bs-list-group-active-bg:var(--bs-primary-text-emphasis);--bs-list-group-active-border-color:var(--bs-primary-text-emphasis)}.list-group-item-secondary{--bs-list-group-color:var(--bs-secondary-text-emphasis);--bs-list-group-bg:var(--bs-secondary-bg-subtle);--bs-list-group-border-color:var(--bs-secondary-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-secondary-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-secondary-border-subtle);--bs-list-group-active-color:var(--bs-secondary-bg-subtle);--bs-list-group-active-bg:var(--bs-secondary-text-emphasis);--bs-list-group-active-border-color:var(--bs-secondary-text-emphasis)}.list-group-item-success{--bs-list-group-color:var(--bs-success-text-emphasis);--bs-list-group-bg:var(--bs-success-bg-subtle);--bs-list-group-border-color:var(--bs-success-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-success-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-success-border-subtle);--bs-list-group-active-color:var(--bs-success-bg-subtle);--bs-list-group-active-bg:var(--bs-success-text-emphasis);--bs-list-group-active-border-color:var(--bs-success-text-emphasis)}.list-group-item-info{--bs-list-group-color:var(--bs-info-text-emphasis);--bs-list-group-bg:var(--bs-info-bg-subtle);--bs-list-group-border-color:var(--bs-info-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-info-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-info-border-subtle);--bs-list-group-active-color:var(--bs-info-bg-subtle);--bs-list-group-active-bg:var(--bs-info-text-emphasis);--bs-list-group-active-border-color:var(--bs-info-text-emphasis)}.list-group-item-warning{--bs-list-group-color:var(--bs-warning-text-emphasis);--bs-list-group-bg:var(--bs-warning-bg-subtle);--bs-list-group-border-color:var(--bs-warning-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-warning-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-warning-border-subtle);--bs-list-group-active-color:var(--bs-warning-bg-subtle);--bs-list-group-active-bg:var(--bs-warning-text-emphasis);--bs-list-group-active-border-color:var(--bs-warning-text-emphasis)}.list-group-item-danger{--bs-list-group-color:var(--bs-danger-text-emphasis);--bs-list-group-bg:var(--bs-danger-bg-subtle);--bs-list-group-border-color:var(--bs-danger-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-danger-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-danger-border-subtle);--bs-list-group-active-color:var(--bs-danger-bg-subtle);--bs-list-group-active-bg:var(--bs-danger-text-emphasis);--bs-list-group-active-border-color:var(--bs-danger-text-emphasis)}.list-group-item-light{--bs-list-group-color:var(--bs-light-text-emphasis);--bs-list-group-bg:var(--bs-light-bg-subtle);--bs-list-group-border-color:var(--bs-light-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-light-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-light-border-subtle);--bs-list-group-active-color:var(--bs-light-bg-subtle);--bs-list-group-active-bg:var(--bs-light-text-emphasis);--bs-list-group-active-border-color:var(--bs-light-text-emphasis)}.list-group-item-dark{--bs-list-group-color:var(--bs-dark-text-emphasis);--bs-list-group-bg:var(--bs-dark-bg-subtle);--bs-list-group-border-color:var(--bs-dark-border-subtle);--bs-list-group-action-hover-color:var(--bs-emphasis-color);--bs-list-group-action-hover-bg:var(--bs-dark-border-subtle);--bs-list-group-action-active-color:var(--bs-emphasis-color);--bs-list-group-action-active-bg:var(--bs-dark-border-subtle);--bs-list-group-active-color:var(--bs-dark-bg-subtle);--bs-list-group-active-bg:var(--bs-dark-text-emphasis);--bs-list-group-active-border-color:var(--bs-dark-text-emphasis)}.btn-close{--bs-btn-close-color:#000;--bs-btn-close-bg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");--bs-btn-close-opacity:0.5;--bs-btn-close-hover-opacity:0.75;--bs-btn-close-focus-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-btn-close-focus-opacity:1;--bs-btn-close-disabled-opacity:0.25;--bs-btn-close-white-filter:invert(1) grayscale(100%) brightness(200%);box-sizing:content-box;width:1em;height:1em;padding:.25em .25em;color:var(--bs-btn-close-color);background:transparent var(--bs-btn-close-bg) center/1em auto no-repeat;border:0;border-radius:.375rem;opacity:var(--bs-btn-close-opacity)}.btn-close:hover{color:var(--bs-btn-close-color);text-decoration:none;opacity:var(--bs-btn-close-hover-opacity)}.btn-close:focus{outline:0;box-shadow:var(--bs-btn-close-focus-shadow);opacity:var(--bs-btn-close-focus-opacity)}.btn-close.disabled,.btn-close:disabled{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--bs-btn-close-disabled-opacity)}.btn-close-white{filter:var(--bs-btn-close-white-filter)}[data-bs-theme=dark] .btn-close{filter:var(--bs-btn-close-white-filter)}.toast{--bs-toast-zindex:1090;--bs-toast-padding-x:0.75rem;--bs-toast-padding-y:0.5rem;--bs-toast-spacing:1.5rem;--bs-toast-max-width:350px;--bs-toast-font-size:0.875rem;--bs-toast-color: ;--bs-toast-bg:rgba(var(--bs-body-bg-rgb), 0.85);--bs-toast-border-width:var(--bs-border-width);--bs-toast-border-color:var(--bs-border-color-translucent);--bs-toast-border-radius:var(--bs-border-radius);--bs-toast-box-shadow:var(--bs-box-shadow);--bs-toast-header-color:var(--bs-secondary-color);--bs-toast-header-bg:rgba(var(--bs-body-bg-rgb), 0.85);--bs-toast-header-border-color:var(--bs-border-color-translucent);width:var(--bs-toast-max-width);max-width:100%;font-size:var(--bs-toast-font-size);color:var(--bs-toast-color);pointer-events:auto;background-color:var(--bs-toast-bg);background-clip:padding-box;border:var(--bs-toast-border-width) solid var(--bs-toast-border-color);box-shadow:var(--bs-toast-box-shadow);border-radius:var(--bs-toast-border-radius)}.toast.showing{opacity:0}.toast:not(.show){display:none}.toast-container{--bs-toast-zindex:1090;position:absolute;z-index:var(--bs-toast-zindex);width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:100%;pointer-events:none}.toast-container>:not(:last-child){margin-bottom:var(--bs-toast-spacing)}.toast-header{display:flex;align-items:center;padding:var(--bs-toast-padding-y) var(--bs-toast-padding-x);color:var(--bs-toast-header-color);background-color:var(--bs-toast-header-bg);background-clip:padding-box;border-bottom:var(--bs-toast-border-width) solid var(--bs-toast-header-border-color);border-top-left-radius:calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width));border-top-right-radius:calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width))}.toast-header .btn-close{margin-right:calc(-.5 * var(--bs-toast-padding-x));margin-left:var(--bs-toast-padding-x)}.toast-body{padding:var(--bs-toast-padding-x);word-wrap:break-word}.modal{--bs-modal-zindex:1055;--bs-modal-width:500px;--bs-modal-padding:1rem;--bs-modal-margin:0.5rem;--bs-modal-color: ;--bs-modal-bg:var(--bs-body-bg);--bs-modal-border-color:var(--bs-border-color-translucent);--bs-modal-border-width:var(--bs-border-width);--bs-modal-border-radius:var(--bs-border-radius-lg);--bs-modal-box-shadow:var(--bs-box-shadow-sm);--bs-modal-inner-border-radius:calc(var(--bs-border-radius-lg) - (var(--bs-border-width)));--bs-modal-header-padding-x:1rem;--bs-modal-header-padding-y:1rem;--bs-modal-header-padding:1rem 1rem;--bs-modal-header-border-color:var(--bs-border-color);--bs-modal-header-border-width:var(--bs-border-width);--bs-modal-title-line-height:1.5;--bs-modal-footer-gap:0.5rem;--bs-modal-footer-bg: ;--bs-modal-footer-border-color:var(--bs-border-color);--bs-modal-footer-border-width:var(--bs-border-width);position:fixed;top:0;left:0;z-index:var(--bs-modal-zindex);display:none;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;outline:0}.modal-dialog{position:relative;width:auto;margin:var(--bs-modal-margin);pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{height:calc(100% - var(--bs-modal-margin) * 2)}.modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - var(--bs-modal-margin) * 2)}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;color:var(--bs-modal-color);pointer-events:auto;background-color:var(--bs-modal-bg);background-clip:padding-box;border:var(--bs-modal-border-width) solid var(--bs-modal-border-color);border-radius:var(--bs-modal-border-radius);outline:0}.modal-backdrop{--bs-backdrop-zindex:1050;--bs-backdrop-bg:#000;--bs-backdrop-opacity:0.5;position:fixed;top:0;left:0;z-index:var(--bs-backdrop-zindex);width:100vw;height:100vh;background-color:var(--bs-backdrop-bg)}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:var(--bs-backdrop-opacity)}.modal-header{display:flex;flex-shrink:0;align-items:center;padding:var(--bs-modal-header-padding);border-bottom:var(--bs-modal-header-border-width) solid var(--bs-modal-header-border-color);border-top-left-radius:var(--bs-modal-inner-border-radius);border-top-right-radius:var(--bs-modal-inner-border-radius)}.modal-header .btn-close{padding:calc(var(--bs-modal-header-padding-y) * .5) calc(var(--bs-modal-header-padding-x) * .5);margin:calc(-.5 * var(--bs-modal-header-padding-y)) calc(-.5 * var(--bs-modal-header-padding-x)) calc(-.5 * var(--bs-modal-header-padding-y)) auto}.modal-title{margin-bottom:0;line-height:var(--bs-modal-title-line-height)}.modal-body{position:relative;flex:1 1 auto;padding:var(--bs-modal-padding)}.modal-footer{display:flex;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:calc(var(--bs-modal-padding) - var(--bs-modal-footer-gap) * .5);background-color:var(--bs-modal-footer-bg);border-top:var(--bs-modal-footer-border-width) solid var(--bs-modal-footer-border-color);border-bottom-right-radius:var(--bs-modal-inner-border-radius);border-bottom-left-radius:var(--bs-modal-inner-border-radius)}.modal-footer>*{margin:calc(var(--bs-modal-footer-gap) * .5)}@media (min-width:576px){.modal{--bs-modal-margin:1.75rem;--bs-modal-box-shadow:var(--bs-box-shadow)}.modal-dialog{max-width:var(--bs-modal-width);margin-right:auto;margin-left:auto}.modal-sm{--bs-modal-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{--bs-modal-width:800px}}@media (min-width:1200px){.modal-xl{--bs-modal-width:1140px}}.modal-fullscreen{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen .modal-footer,.modal-fullscreen .modal-header{border-radius:0}.modal-fullscreen .modal-body{overflow-y:auto}@media (max-width:575.98px){.modal-fullscreen-sm-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-sm-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-sm-down .modal-footer,.modal-fullscreen-sm-down .modal-header{border-radius:0}.modal-fullscreen-sm-down .modal-body{overflow-y:auto}}@media (max-width:767.98px){.modal-fullscreen-md-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-md-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-md-down .modal-footer,.modal-fullscreen-md-down .modal-header{border-radius:0}.modal-fullscreen-md-down .modal-body{overflow-y:auto}}@media (max-width:991.98px){.modal-fullscreen-lg-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-lg-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-lg-down .modal-footer,.modal-fullscreen-lg-down .modal-header{border-radius:0}.modal-fullscreen-lg-down .modal-body{overflow-y:auto}}@media (max-width:1199.98px){.modal-fullscreen-xl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xl-down .modal-footer,.modal-fullscreen-xl-down .modal-header{border-radius:0}.modal-fullscreen-xl-down .modal-body{overflow-y:auto}}@media (max-width:1399.98px){.modal-fullscreen-xxl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xxl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xxl-down .modal-footer,.modal-fullscreen-xxl-down .modal-header{border-radius:0}.modal-fullscreen-xxl-down .modal-body{overflow-y:auto}}.tooltip{--bs-tooltip-zindex:1080;--bs-tooltip-max-width:200px;--bs-tooltip-padding-x:0.5rem;--bs-tooltip-padding-y:0.25rem;--bs-tooltip-margin: ;--bs-tooltip-font-size:0.875rem;--bs-tooltip-color:var(--bs-body-bg);--bs-tooltip-bg:var(--bs-emphasis-color);--bs-tooltip-border-radius:var(--bs-border-radius);--bs-tooltip-opacity:0.9;--bs-tooltip-arrow-width:0.8rem;--bs-tooltip-arrow-height:0.4rem;z-index:var(--bs-tooltip-zindex);display:block;margin:var(--bs-tooltip-margin);font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-tooltip-font-size);word-wrap:break-word;opacity:0}.tooltip.show{opacity:var(--bs-tooltip-opacity)}.tooltip .tooltip-arrow{display:block;width:var(--bs-tooltip-arrow-width);height:var(--bs-tooltip-arrow-height)}.tooltip .tooltip-arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow,.bs-tooltip-top .tooltip-arrow{bottom:calc(-1 * var(--bs-tooltip-arrow-height))}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,.bs-tooltip-top .tooltip-arrow::before{top:-1px;border-width:var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-top-color:var(--bs-tooltip-bg)}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow,.bs-tooltip-end .tooltip-arrow{left:calc(-1 * var(--bs-tooltip-arrow-height));width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before,.bs-tooltip-end .tooltip-arrow::before{right:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-right-color:var(--bs-tooltip-bg)}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow,.bs-tooltip-bottom .tooltip-arrow{top:calc(-1 * var(--bs-tooltip-arrow-height))}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before,.bs-tooltip-bottom .tooltip-arrow::before{bottom:-1px;border-width:0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-bottom-color:var(--bs-tooltip-bg)}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow,.bs-tooltip-start .tooltip-arrow{right:calc(-1 * var(--bs-tooltip-arrow-height));width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before,.bs-tooltip-start .tooltip-arrow::before{left:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) 0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-left-color:var(--bs-tooltip-bg)}.tooltip-inner{max-width:var(--bs-tooltip-max-width);padding:var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x);color:var(--bs-tooltip-color);text-align:center;background-color:var(--bs-tooltip-bg);border-radius:var(--bs-tooltip-border-radius)}.popover{--bs-popover-zindex:1070;--bs-popover-max-width:276px;--bs-popover-font-size:0.875rem;--bs-popover-bg:var(--bs-body-bg);--bs-popover-border-width:var(--bs-border-width);--bs-popover-border-color:var(--bs-border-color-translucent);--bs-popover-border-radius:var(--bs-border-radius-lg);--bs-popover-inner-border-radius:calc(var(--bs-border-radius-lg) - var(--bs-border-width));--bs-popover-box-shadow:var(--bs-box-shadow);--bs-popover-header-padding-x:1rem;--bs-popover-header-padding-y:0.5rem;--bs-popover-header-font-size:1rem;--bs-popover-header-color:inherit;--bs-popover-header-bg:var(--bs-secondary-bg);--bs-popover-body-padding-x:1rem;--bs-popover-body-padding-y:1rem;--bs-popover-body-color:var(--bs-body-color);--bs-popover-arrow-width:1rem;--bs-popover-arrow-height:0.5rem;--bs-popover-arrow-border:var(--bs-popover-border-color);z-index:var(--bs-popover-zindex);display:block;max-width:var(--bs-popover-max-width);font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-popover-font-size);word-wrap:break-word;background-color:var(--bs-popover-bg);background-clip:padding-box;border:var(--bs-popover-border-width) solid var(--bs-popover-border-color);border-radius:var(--bs-popover-border-radius)}.popover .popover-arrow{display:block;width:var(--bs-popover-arrow-width);height:var(--bs-popover-arrow-height)}.popover .popover-arrow::after,.popover .popover-arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid;border-width:0}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow,.bs-popover-top>.popover-arrow{bottom:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width))}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,.bs-popover-top>.popover-arrow::after,.bs-popover-top>.popover-arrow::before{border-width:var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width) * .5) 0}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,.bs-popover-top>.popover-arrow::before{bottom:0;border-top-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after,.bs-popover-top>.popover-arrow::after{bottom:var(--bs-popover-border-width);border-top-color:var(--bs-popover-bg)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow,.bs-popover-end>.popover-arrow{left:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));width:var(--bs-popover-arrow-height);height:var(--bs-popover-arrow-width)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,.bs-popover-end>.popover-arrow::after,.bs-popover-end>.popover-arrow::before{border-width:calc(var(--bs-popover-arrow-width) * .5) var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width) * .5) 0}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,.bs-popover-end>.popover-arrow::before{left:0;border-right-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after,.bs-popover-end>.popover-arrow::after{left:var(--bs-popover-border-width);border-right-color:var(--bs-popover-bg)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow,.bs-popover-bottom>.popover-arrow{top:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width))}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,.bs-popover-bottom>.popover-arrow::after,.bs-popover-bottom>.popover-arrow::before{border-width:0 calc(var(--bs-popover-arrow-width) * .5) var(--bs-popover-arrow-height)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,.bs-popover-bottom>.popover-arrow::before{top:0;border-bottom-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after,.bs-popover-bottom>.popover-arrow::after{top:var(--bs-popover-border-width);border-bottom-color:var(--bs-popover-bg)}.bs-popover-auto[data-popper-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:var(--bs-popover-arrow-width);margin-left:calc(-.5 * var(--bs-popover-arrow-width));content:"";border-bottom:var(--bs-popover-border-width) solid var(--bs-popover-header-bg)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow,.bs-popover-start>.popover-arrow{right:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));width:var(--bs-popover-arrow-height);height:var(--bs-popover-arrow-width)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,.bs-popover-start>.popover-arrow::after,.bs-popover-start>.popover-arrow::before{border-width:calc(var(--bs-popover-arrow-width) * .5) 0 calc(var(--bs-popover-arrow-width) * .5) var(--bs-popover-arrow-height)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,.bs-popover-start>.popover-arrow::before{right:0;border-left-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after,.bs-popover-start>.popover-arrow::after{right:var(--bs-popover-border-width);border-left-color:var(--bs-popover-bg)}.popover-header{padding:var(--bs-popover-header-padding-y) var(--bs-popover-header-padding-x);margin-bottom:0;font-size:var(--bs-popover-header-font-size);color:var(--bs-popover-header-color);background-color:var(--bs-popover-header-bg);border-bottom:var(--bs-popover-border-width) solid var(--bs-popover-border-color);border-top-left-radius:var(--bs-popover-inner-border-radius);border-top-right-radius:var(--bs-popover-inner-border-radius)}.popover-header:empty{display:none}.popover-body{padding:var(--bs-popover-body-padding-y) var(--bs-popover-body-padding-x);color:var(--bs-popover-body-color)}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-end,.carousel-item-next:not(.carousel-item-start){transform:translateX(100%)}.active.carousel-item-start,.carousel-item-prev:not(.carousel-item-end){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-start,.carousel-fade .carousel-item-prev.carousel-item-end,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;padding:0;color:#fff;text-align:center;background:0 0;border:0;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:2rem;height:2rem;background-repeat:no-repeat;background-position:50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:2;display:flex;justify-content:center;padding:0;margin-right:15%;margin-bottom:1rem;margin-left:15%}.carousel-indicators [data-bs-target]{box-sizing:content-box;flex:0 1 auto;width:30px;height:3px;padding:0;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border:0;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators [data-bs-target]{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:1.25rem;left:15%;padding-top:1.25rem;padding-bottom:1.25rem;color:#fff;text-align:center}.carousel-dark .carousel-control-next-icon,.carousel-dark .carousel-control-prev-icon{filter:invert(1) grayscale(100)}.carousel-dark .carousel-indicators [data-bs-target]{background-color:#000}.carousel-dark .carousel-caption{color:#000}[data-bs-theme=dark] .carousel .carousel-control-next-icon,[data-bs-theme=dark] .carousel .carousel-control-prev-icon,[data-bs-theme=dark].carousel .carousel-control-next-icon,[data-bs-theme=dark].carousel .carousel-control-prev-icon{filter:invert(1) grayscale(100)}[data-bs-theme=dark] .carousel .carousel-indicators [data-bs-target],[data-bs-theme=dark].carousel .carousel-indicators [data-bs-target]{background-color:#000}[data-bs-theme=dark] .carousel .carousel-caption,[data-bs-theme=dark].carousel .carousel-caption{color:#000}.spinner-border,.spinner-grow{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg)}}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion:reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.offcanvas,.offcanvas-lg,.offcanvas-md,.offcanvas-sm,.offcanvas-xl,.offcanvas-xxl{--bs-offcanvas-zindex:1045;--bs-offcanvas-width:400px;--bs-offcanvas-height:30vh;--bs-offcanvas-padding-x:1rem;--bs-offcanvas-padding-y:1rem;--bs-offcanvas-color:var(--bs-body-color);--bs-offcanvas-bg:var(--bs-body-bg);--bs-offcanvas-border-width:var(--bs-border-width);--bs-offcanvas-border-color:var(--bs-border-color-translucent);--bs-offcanvas-box-shadow:var(--bs-box-shadow-sm);--bs-offcanvas-transition:transform 0.3s ease-in-out;--bs-offcanvas-title-line-height:1.5}@media (max-width:575.98px){.offcanvas-sm{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media (max-width:575.98px) and (prefers-reduced-motion:reduce){.offcanvas-sm{transition:none}}@media (max-width:575.98px){.offcanvas-sm.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-sm.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-sm.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-sm.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-sm.show:not(.hiding),.offcanvas-sm.showing{transform:none}.offcanvas-sm.hiding,.offcanvas-sm.show,.offcanvas-sm.showing{visibility:visible}}@media (min-width:576px){.offcanvas-sm{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-sm .offcanvas-header{display:none}.offcanvas-sm .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:767.98px){.offcanvas-md{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media (max-width:767.98px) and (prefers-reduced-motion:reduce){.offcanvas-md{transition:none}}@media (max-width:767.98px){.offcanvas-md.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-md.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-md.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-md.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-md.show:not(.hiding),.offcanvas-md.showing{transform:none}.offcanvas-md.hiding,.offcanvas-md.show,.offcanvas-md.showing{visibility:visible}}@media (min-width:768px){.offcanvas-md{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-md .offcanvas-header{display:none}.offcanvas-md .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:991.98px){.offcanvas-lg{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media (max-width:991.98px) and (prefers-reduced-motion:reduce){.offcanvas-lg{transition:none}}@media (max-width:991.98px){.offcanvas-lg.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-lg.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-lg.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-lg.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-lg.show:not(.hiding),.offcanvas-lg.showing{transform:none}.offcanvas-lg.hiding,.offcanvas-lg.show,.offcanvas-lg.showing{visibility:visible}}@media (min-width:992px){.offcanvas-lg{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-lg .offcanvas-header{display:none}.offcanvas-lg .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:1199.98px){.offcanvas-xl{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media (max-width:1199.98px) and (prefers-reduced-motion:reduce){.offcanvas-xl{transition:none}}@media (max-width:1199.98px){.offcanvas-xl.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-xl.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-xl.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-xl.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-xl.show:not(.hiding),.offcanvas-xl.showing{transform:none}.offcanvas-xl.hiding,.offcanvas-xl.show,.offcanvas-xl.showing{visibility:visible}}@media (min-width:1200px){.offcanvas-xl{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-xl .offcanvas-header{display:none}.offcanvas-xl .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:1399.98px){.offcanvas-xxl{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}}@media (max-width:1399.98px) and (prefers-reduced-motion:reduce){.offcanvas-xxl{transition:none}}@media (max-width:1399.98px){.offcanvas-xxl.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas-xxl.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas-xxl.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas-xxl.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas-xxl.show:not(.hiding),.offcanvas-xxl.showing{transform:none}.offcanvas-xxl.hiding,.offcanvas-xxl.show,.offcanvas-xxl.showing{visibility:visible}}@media (min-width:1400px){.offcanvas-xxl{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-xxl .offcanvas-header{display:none}.offcanvas-xxl .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}.offcanvas{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:var(--bs-offcanvas-transition)}@media (prefers-reduced-motion:reduce){.offcanvas{transition:none}}.offcanvas.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas.show:not(.hiding),.offcanvas.showing{transform:none}.offcanvas.hiding,.offcanvas.show,.offcanvas.showing{visibility:visible}.offcanvas-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.offcanvas-backdrop.fade{opacity:0}.offcanvas-backdrop.show{opacity:.5}.offcanvas-header{display:flex;align-items:center;padding:var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x)}.offcanvas-header .btn-close{padding:calc(var(--bs-offcanvas-padding-y) * .5) calc(var(--bs-offcanvas-padding-x) * .5);margin:calc(-.5 * var(--bs-offcanvas-padding-y)) calc(-.5 * var(--bs-offcanvas-padding-x)) calc(-.5 * var(--bs-offcanvas-padding-y)) auto}.offcanvas-title{margin-bottom:0;line-height:var(--bs-offcanvas-title-line-height)}.offcanvas-body{flex-grow:1;padding:var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x);overflow-y:auto}.placeholder{display:inline-block;min-height:1em;vertical-align:middle;cursor:wait;background-color:currentcolor;opacity:.5}.placeholder.btn::before{display:inline-block;content:""}.placeholder-xs{min-height:.6em}.placeholder-sm{min-height:.8em}.placeholder-lg{min-height:1.2em}.placeholder-glow .placeholder{animation:placeholder-glow 2s ease-in-out infinite}@keyframes placeholder-glow{50%{opacity:.2}}.placeholder-wave{-webkit-mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,0.8) 75%,#000 95%);mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,0.8) 75%,#000 95%);-webkit-mask-size:200% 100%;mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-wave{100%{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff!important;background-color:RGBA(var(--bs-primary-rgb),var(--bs-bg-opacity,1))!important}.text-bg-secondary{color:#fff!important;background-color:RGBA(var(--bs-secondary-rgb),var(--bs-bg-opacity,1))!important}.text-bg-success{color:#fff!important;background-color:RGBA(var(--bs-success-rgb),var(--bs-bg-opacity,1))!important}.text-bg-info{color:#000!important;background-color:RGBA(var(--bs-info-rgb),var(--bs-bg-opacity,1))!important}.text-bg-warning{color:#000!important;background-color:RGBA(var(--bs-warning-rgb),var(--bs-bg-opacity,1))!important}.text-bg-danger{color:#fff!important;background-color:RGBA(var(--bs-danger-rgb),var(--bs-bg-opacity,1))!important}.text-bg-light{color:#000!important;background-color:RGBA(var(--bs-light-rgb),var(--bs-bg-opacity,1))!important}.text-bg-dark{color:#fff!important;background-color:RGBA(var(--bs-dark-rgb),var(--bs-bg-opacity,1))!important}.link-primary{color:RGBA(var(--bs-primary-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-primary-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-primary-rgb),var(--bs-link-underline-opacity,1))!important}.link-primary:focus,.link-primary:hover{color:RGBA(10,88,202,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(10,88,202,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(10,88,202,var(--bs-link-underline-opacity,1))!important}.link-secondary{color:RGBA(var(--bs-secondary-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-secondary-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-secondary-rgb),var(--bs-link-underline-opacity,1))!important}.link-secondary:focus,.link-secondary:hover{color:RGBA(86,94,100,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(86,94,100,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(86,94,100,var(--bs-link-underline-opacity,1))!important}.link-success{color:RGBA(var(--bs-success-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-success-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-success-rgb),var(--bs-link-underline-opacity,1))!important}.link-success:focus,.link-success:hover{color:RGBA(20,108,67,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(20,108,67,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(20,108,67,var(--bs-link-underline-opacity,1))!important}.link-info{color:RGBA(var(--bs-info-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-info-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-info-rgb),var(--bs-link-underline-opacity,1))!important}.link-info:focus,.link-info:hover{color:RGBA(61,213,243,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(61,213,243,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(61,213,243,var(--bs-link-underline-opacity,1))!important}.link-warning{color:RGBA(var(--bs-warning-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-warning-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-warning-rgb),var(--bs-link-underline-opacity,1))!important}.link-warning:focus,.link-warning:hover{color:RGBA(255,205,57,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(255,205,57,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(255,205,57,var(--bs-link-underline-opacity,1))!important}.link-danger{color:RGBA(var(--bs-danger-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-danger-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-danger-rgb),var(--bs-link-underline-opacity,1))!important}.link-danger:focus,.link-danger:hover{color:RGBA(176,42,55,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(176,42,55,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(176,42,55,var(--bs-link-underline-opacity,1))!important}.link-light{color:RGBA(var(--bs-light-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-light-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-light-rgb),var(--bs-link-underline-opacity,1))!important}.link-light:focus,.link-light:hover{color:RGBA(249,250,251,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(249,250,251,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(249,250,251,var(--bs-link-underline-opacity,1))!important}.link-dark{color:RGBA(var(--bs-dark-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-dark-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-dark-rgb),var(--bs-link-underline-opacity,1))!important}.link-dark:focus,.link-dark:hover{color:RGBA(26,30,33,var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(26,30,33,var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(26,30,33,var(--bs-link-underline-opacity,1))!important}.link-body-emphasis{color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-opacity,1))!important;-webkit-text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity,1))!important}.link-body-emphasis:focus,.link-body-emphasis:hover{color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-opacity,.75))!important;-webkit-text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity,0.75))!important;text-decoration-color:RGBA(var(--bs-emphasis-color-rgb),var(--bs-link-underline-opacity,0.75))!important}.focus-ring:focus{outline:0;box-shadow:var(--bs-focus-ring-x,0) var(--bs-focus-ring-y,0) var(--bs-focus-ring-blur,0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.icon-link{display:inline-flex;gap:.375rem;align-items:center;-webkit-text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,0.5));text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,0.5));text-underline-offset:0.25em;-webkit-backface-visibility:hidden;backface-visibility:hidden}.icon-link>.bi{flex-shrink:0;width:1em;height:1em;fill:currentcolor;transition:.2s ease-in-out transform}@media (prefers-reduced-motion:reduce){.icon-link>.bi{transition:none}}.icon-link-hover:focus-visible>.bi,.icon-link-hover:hover>.bi{transform:var(--bs-icon-link-transform,translate3d(.25em,0,0))}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}@media (min-width:576px){.sticky-sm-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:768px){.sticky-md-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:992px){.sticky-lg-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:1200px){.sticky-xl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:1400px){.sticky-xxl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.visually-hidden-focusable:not(:focus):not(:focus-within):not(caption),.visually-hidden:not(caption){position:absolute!important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:var(--bs-border-width);min-height:1em;background-color:currentcolor;opacity:.25}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.float-start{float:left!important}.float-end{float:right!important}.float-none{float:none!important}.object-fit-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-fit-cover{-o-object-fit:cover!important;object-fit:cover!important}.object-fit-fill{-o-object-fit:fill!important;object-fit:fill!important}.object-fit-scale{-o-object-fit:scale-down!important;object-fit:scale-down!important}.object-fit-none{-o-object-fit:none!important;object-fit:none!important}.opacity-0{opacity:0!important}.opacity-25{opacity:.25!important}.opacity-50{opacity:.5!important}.opacity-75{opacity:.75!important}.opacity-100{opacity:1!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-visible{overflow:visible!important}.overflow-scroll{overflow:scroll!important}.overflow-x-auto{overflow-x:auto!important}.overflow-x-hidden{overflow-x:hidden!important}.overflow-x-visible{overflow-x:visible!important}.overflow-x-scroll{overflow-x:scroll!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-visible{overflow-y:visible!important}.overflow-y-scroll{overflow-y:scroll!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-grid{display:grid!important}.d-inline-grid{display:inline-grid!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}.d-none{display:none!important}.shadow{box-shadow:var(--bs-box-shadow)!important}.shadow-sm{box-shadow:var(--bs-box-shadow-sm)!important}.shadow-lg{box-shadow:var(--bs-box-shadow-lg)!important}.shadow-none{box-shadow:none!important}.focus-ring-primary{--bs-focus-ring-color:rgba(var(--bs-primary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-secondary{--bs-focus-ring-color:rgba(var(--bs-secondary-rgb), var(--bs-focus-ring-opacity))}.focus-ring-success{--bs-focus-ring-color:rgba(var(--bs-success-rgb), var(--bs-focus-ring-opacity))}.focus-ring-info{--bs-focus-ring-color:rgba(var(--bs-info-rgb), var(--bs-focus-ring-opacity))}.focus-ring-warning{--bs-focus-ring-color:rgba(var(--bs-warning-rgb), var(--bs-focus-ring-opacity))}.focus-ring-danger{--bs-focus-ring-color:rgba(var(--bs-danger-rgb), var(--bs-focus-ring-opacity))}.focus-ring-light{--bs-focus-ring-color:rgba(var(--bs-light-rgb), var(--bs-focus-ring-opacity))}.focus-ring-dark{--bs-focus-ring-color:rgba(var(--bs-dark-rgb), var(--bs-focus-ring-opacity))}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.top-0{top:0!important}.top-50{top:50%!important}.top-100{top:100%!important}.bottom-0{bottom:0!important}.bottom-50{bottom:50%!important}.bottom-100{bottom:100%!important}.start-0{left:0!important}.start-50{left:50%!important}.start-100{left:100%!important}.end-0{right:0!important}.end-50{right:50%!important}.end-100{right:100%!important}.translate-middle{transform:translate(-50%,-50%)!important}.translate-middle-x{transform:translateX(-50%)!important}.translate-middle-y{transform:translateY(-50%)!important}.border{border:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-0{border:0!important}.border-top{border-top:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-top-0{border-top:0!important}.border-end{border-right:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-end-0{border-right:0!important}.border-bottom{border-bottom:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-bottom-0{border-bottom:0!important}.border-start{border-left:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-start-0{border-left:0!important}.border-primary{--bs-border-opacity:1;border-color:rgba(var(--bs-primary-rgb),var(--bs-border-opacity))!important}.border-secondary{--bs-border-opacity:1;border-color:rgba(var(--bs-secondary-rgb),var(--bs-border-opacity))!important}.border-success{--bs-border-opacity:1;border-color:rgba(var(--bs-success-rgb),var(--bs-border-opacity))!important}.border-info{--bs-border-opacity:1;border-color:rgba(var(--bs-info-rgb),var(--bs-border-opacity))!important}.border-warning{--bs-border-opacity:1;border-color:rgba(var(--bs-warning-rgb),var(--bs-border-opacity))!important}.border-danger{--bs-border-opacity:1;border-color:rgba(var(--bs-danger-rgb),var(--bs-border-opacity))!important}.border-light{--bs-border-opacity:1;border-color:rgba(var(--bs-light-rgb),var(--bs-border-opacity))!important}.border-dark{--bs-border-opacity:1;border-color:rgba(var(--bs-dark-rgb),var(--bs-border-opacity))!important}.border-black{--bs-border-opacity:1;border-color:rgba(var(--bs-black-rgb),var(--bs-border-opacity))!important}.border-white{--bs-border-opacity:1;border-color:rgba(var(--bs-white-rgb),var(--bs-border-opacity))!important}.border-primary-subtle{border-color:var(--bs-primary-border-subtle)!important}.border-secondary-subtle{border-color:var(--bs-secondary-border-subtle)!important}.border-success-subtle{border-color:var(--bs-success-border-subtle)!important}.border-info-subtle{border-color:var(--bs-info-border-subtle)!important}.border-warning-subtle{border-color:var(--bs-warning-border-subtle)!important}.border-danger-subtle{border-color:var(--bs-danger-border-subtle)!important}.border-light-subtle{border-color:var(--bs-light-border-subtle)!important}.border-dark-subtle{border-color:var(--bs-dark-border-subtle)!important}.border-1{border-width:1px!important}.border-2{border-width:2px!important}.border-3{border-width:3px!important}.border-4{border-width:4px!important}.border-5{border-width:5px!important}.border-opacity-10{--bs-border-opacity:0.1}.border-opacity-25{--bs-border-opacity:0.25}.border-opacity-50{--bs-border-opacity:0.5}.border-opacity-75{--bs-border-opacity:0.75}.border-opacity-100{--bs-border-opacity:1}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.mw-100{max-width:100%!important}.vw-100{width:100vw!important}.min-vw-100{min-width:100vw!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mh-100{max-height:100%!important}.vh-100{height:100vh!important}.min-vh-100{min-height:100vh!important}.flex-fill{flex:1 1 auto!important}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.justify-content-evenly{justify-content:space-evenly!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.order-first{order:-1!important}.order-0{order:0!important}.order-1{order:1!important}.order-2{order:2!important}.order-3{order:3!important}.order-4{order:4!important}.order-5{order:5!important}.order-last{order:6!important}.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}.mx-0{margin-right:0!important;margin-left:0!important}.mx-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-3{margin-right:1rem!important;margin-left:1rem!important}.mx-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-5{margin-right:3rem!important;margin-left:3rem!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.my-0{margin-top:0!important;margin-bottom:0!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-4{margin-right:1.5rem!important}.me-5{margin-right:3rem!important}.me-auto{margin-right:auto!important}.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-4{margin-left:1.5rem!important}.ms-5{margin-left:3rem!important}.ms-auto{margin-left:auto!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important}.px-0{padding-right:0!important;padding-left:0!important}.px-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-3{padding-right:1rem!important;padding-left:1rem!important}.px-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-5{padding-right:3rem!important;padding-left:3rem!important}.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important}.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important}.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important}.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important}.gap-0{gap:0!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-3{gap:1rem!important}.gap-4{gap:1.5rem!important}.gap-5{gap:3rem!important}.row-gap-0{row-gap:0!important}.row-gap-1{row-gap:.25rem!important}.row-gap-2{row-gap:.5rem!important}.row-gap-3{row-gap:1rem!important}.row-gap-4{row-gap:1.5rem!important}.row-gap-5{row-gap:3rem!important}.column-gap-0{-moz-column-gap:0!important;column-gap:0!important}.column-gap-1{-moz-column-gap:0.25rem!important;column-gap:.25rem!important}.column-gap-2{-moz-column-gap:0.5rem!important;column-gap:.5rem!important}.column-gap-3{-moz-column-gap:1rem!important;column-gap:1rem!important}.column-gap-4{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.column-gap-5{-moz-column-gap:3rem!important;column-gap:3rem!important}.font-monospace{font-family:var(--bs-font-monospace)!important}.fs-1{font-size:calc(1.375rem + 1.5vw)!important}.fs-2{font-size:calc(1.325rem + .9vw)!important}.fs-3{font-size:calc(1.3rem + .6vw)!important}.fs-4{font-size:calc(1.275rem + .3vw)!important}.fs-5{font-size:1.25rem!important}.fs-6{font-size:1rem!important}.fst-italic{font-style:italic!important}.fst-normal{font-style:normal!important}.fw-lighter{font-weight:lighter!important}.fw-light{font-weight:300!important}.fw-normal{font-weight:400!important}.fw-medium{font-weight:500!important}.fw-semibold{font-weight:600!important}.fw-bold{font-weight:700!important}.fw-bolder{font-weight:bolder!important}.lh-1{line-height:1!important}.lh-sm{line-height:1.25!important}.lh-base{line-height:1.5!important}.lh-lg{line-height:2!important}.text-start{text-align:left!important}.text-end{text-align:right!important}.text-center{text-align:center!important}.text-decoration-none{text-decoration:none!important}.text-decoration-underline{text-decoration:underline!important}.text-decoration-line-through{text-decoration:line-through!important}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-break{word-wrap:break-word!important;word-break:break-word!important}.text-primary{--bs-text-opacity:1;color:rgba(var(--bs-primary-rgb),var(--bs-text-opacity))!important}.text-secondary{--bs-text-opacity:1;color:rgba(var(--bs-secondary-rgb),var(--bs-text-opacity))!important}.text-success{--bs-text-opacity:1;color:rgba(var(--bs-success-rgb),var(--bs-text-opacity))!important}.text-info{--bs-text-opacity:1;color:rgba(var(--bs-info-rgb),var(--bs-text-opacity))!important}.text-warning{--bs-text-opacity:1;color:rgba(var(--bs-warning-rgb),var(--bs-text-opacity))!important}.text-danger{--bs-text-opacity:1;color:rgba(var(--bs-danger-rgb),var(--bs-text-opacity))!important}.text-light{--bs-text-opacity:1;color:rgba(var(--bs-light-rgb),var(--bs-text-opacity))!important}.text-dark{--bs-text-opacity:1;color:rgba(var(--bs-dark-rgb),var(--bs-text-opacity))!important}.text-black{--bs-text-opacity:1;color:rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important}.text-white{--bs-text-opacity:1;color:rgba(var(--bs-white-rgb),var(--bs-text-opacity))!important}.text-body{--bs-text-opacity:1;color:rgba(var(--bs-body-color-rgb),var(--bs-text-opacity))!important}.text-muted{--bs-text-opacity:1;color:var(--bs-secondary-color)!important}.text-black-50{--bs-text-opacity:1;color:rgba(0,0,0,.5)!important}.text-white-50{--bs-text-opacity:1;color:rgba(255,255,255,.5)!important}.text-body-secondary{--bs-text-opacity:1;color:var(--bs-secondary-color)!important}.text-body-tertiary{--bs-text-opacity:1;color:var(--bs-tertiary-color)!important}.text-body-emphasis{--bs-text-opacity:1;color:var(--bs-emphasis-color)!important}.text-reset{--bs-text-opacity:1;color:inherit!important}.text-opacity-25{--bs-text-opacity:0.25}.text-opacity-50{--bs-text-opacity:0.5}.text-opacity-75{--bs-text-opacity:0.75}.text-opacity-100{--bs-text-opacity:1}.text-primary-emphasis{color:var(--bs-primary-text-emphasis)!important}.text-secondary-emphasis{color:var(--bs-secondary-text-emphasis)!important}.text-success-emphasis{color:var(--bs-success-text-emphasis)!important}.text-info-emphasis{color:var(--bs-info-text-emphasis)!important}.text-warning-emphasis{color:var(--bs-warning-text-emphasis)!important}.text-danger-emphasis{color:var(--bs-danger-text-emphasis)!important}.text-light-emphasis{color:var(--bs-light-text-emphasis)!important}.text-dark-emphasis{color:var(--bs-dark-text-emphasis)!important}.link-opacity-10{--bs-link-opacity:0.1}.link-opacity-10-hover:hover{--bs-link-opacity:0.1}.link-opacity-25{--bs-link-opacity:0.25}.link-opacity-25-hover:hover{--bs-link-opacity:0.25}.link-opacity-50{--bs-link-opacity:0.5}.link-opacity-50-hover:hover{--bs-link-opacity:0.5}.link-opacity-75{--bs-link-opacity:0.75}.link-opacity-75-hover:hover{--bs-link-opacity:0.75}.link-opacity-100{--bs-link-opacity:1}.link-opacity-100-hover:hover{--bs-link-opacity:1}.link-offset-1{text-underline-offset:0.125em!important}.link-offset-1-hover:hover{text-underline-offset:0.125em!important}.link-offset-2{text-underline-offset:0.25em!important}.link-offset-2-hover:hover{text-underline-offset:0.25em!important}.link-offset-3{text-underline-offset:0.375em!important}.link-offset-3-hover:hover{text-underline-offset:0.375em!important}.link-underline-primary{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-primary-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-primary-rgb),var(--bs-link-underline-opacity))!important}.link-underline-secondary{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-secondary-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-secondary-rgb),var(--bs-link-underline-opacity))!important}.link-underline-success{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-success-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-success-rgb),var(--bs-link-underline-opacity))!important}.link-underline-info{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-info-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-info-rgb),var(--bs-link-underline-opacity))!important}.link-underline-warning{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-warning-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-warning-rgb),var(--bs-link-underline-opacity))!important}.link-underline-danger{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-danger-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-danger-rgb),var(--bs-link-underline-opacity))!important}.link-underline-light{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-light-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-light-rgb),var(--bs-link-underline-opacity))!important}.link-underline-dark{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-dark-rgb),var(--bs-link-underline-opacity))!important;text-decoration-color:rgba(var(--bs-dark-rgb),var(--bs-link-underline-opacity))!important}.link-underline{--bs-link-underline-opacity:1;-webkit-text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-underline-opacity,1))!important;text-decoration-color:rgba(var(--bs-link-color-rgb),var(--bs-link-underline-opacity,1))!important}.link-underline-opacity-0{--bs-link-underline-opacity:0}.link-underline-opacity-0-hover:hover{--bs-link-underline-opacity:0}.link-underline-opacity-10{--bs-link-underline-opacity:0.1}.link-underline-opacity-10-hover:hover{--bs-link-underline-opacity:0.1}.link-underline-opacity-25{--bs-link-underline-opacity:0.25}.link-underline-opacity-25-hover:hover{--bs-link-underline-opacity:0.25}.link-underline-opacity-50{--bs-link-underline-opacity:0.5}.link-underline-opacity-50-hover:hover{--bs-link-underline-opacity:0.5}.link-underline-opacity-75{--bs-link-underline-opacity:0.75}.link-underline-opacity-75-hover:hover{--bs-link-underline-opacity:0.75}.link-underline-opacity-100{--bs-link-underline-opacity:1}.link-underline-opacity-100-hover:hover{--bs-link-underline-opacity:1}.bg-primary{--bs-bg-opacity:1;background-color:rgba(var(--bs-primary-rgb),var(--bs-bg-opacity))!important}.bg-secondary{--bs-bg-opacity:1;background-color:rgba(var(--bs-secondary-rgb),var(--bs-bg-opacity))!important}.bg-success{--bs-bg-opacity:1;background-color:rgba(var(--bs-success-rgb),var(--bs-bg-opacity))!important}.bg-info{--bs-bg-opacity:1;background-color:rgba(var(--bs-info-rgb),var(--bs-bg-opacity))!important}.bg-warning{--bs-bg-opacity:1;background-color:rgba(var(--bs-warning-rgb),var(--bs-bg-opacity))!important}.bg-danger{--bs-bg-opacity:1;background-color:rgba(var(--bs-danger-rgb),var(--bs-bg-opacity))!important}.bg-light{--bs-bg-opacity:1;background-color:rgba(var(--bs-light-rgb),var(--bs-bg-opacity))!important}.bg-dark{--bs-bg-opacity:1;background-color:rgba(var(--bs-dark-rgb),var(--bs-bg-opacity))!important}.bg-black{--bs-bg-opacity:1;background-color:rgba(var(--bs-black-rgb),var(--bs-bg-opacity))!important}.bg-white{--bs-bg-opacity:1;background-color:rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important}.bg-body{--bs-bg-opacity:1;background-color:rgba(var(--bs-body-bg-rgb),var(--bs-bg-opacity))!important}.bg-transparent{--bs-bg-opacity:1;background-color:transparent!important}.bg-body-secondary{--bs-bg-opacity:1;background-color:rgba(var(--bs-secondary-bg-rgb),var(--bs-bg-opacity))!important}.bg-body-tertiary{--bs-bg-opacity:1;background-color:rgba(var(--bs-tertiary-bg-rgb),var(--bs-bg-opacity))!important}.bg-opacity-10{--bs-bg-opacity:0.1}.bg-opacity-25{--bs-bg-opacity:0.25}.bg-opacity-50{--bs-bg-opacity:0.5}.bg-opacity-75{--bs-bg-opacity:0.75}.bg-opacity-100{--bs-bg-opacity:1}.bg-primary-subtle{background-color:var(--bs-primary-bg-subtle)!important}.bg-secondary-subtle{background-color:var(--bs-secondary-bg-subtle)!important}.bg-success-subtle{background-color:var(--bs-success-bg-subtle)!important}.bg-info-subtle{background-color:var(--bs-info-bg-subtle)!important}.bg-warning-subtle{background-color:var(--bs-warning-bg-subtle)!important}.bg-danger-subtle{background-color:var(--bs-danger-bg-subtle)!important}.bg-light-subtle{background-color:var(--bs-light-bg-subtle)!important}.bg-dark-subtle{background-color:var(--bs-dark-bg-subtle)!important}.bg-gradient{background-image:var(--bs-gradient)!important}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.pe-none{pointer-events:none!important}.pe-auto{pointer-events:auto!important}.rounded{border-radius:var(--bs-border-radius)!important}.rounded-0{border-radius:0!important}.rounded-1{border-radius:var(--bs-border-radius-sm)!important}.rounded-2{border-radius:var(--bs-border-radius)!important}.rounded-3{border-radius:var(--bs-border-radius-lg)!important}.rounded-4{border-radius:var(--bs-border-radius-xl)!important}.rounded-5{border-radius:var(--bs-border-radius-xxl)!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:var(--bs-border-radius-pill)!important}.rounded-top{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-top-0{border-top-left-radius:0!important;border-top-right-radius:0!important}.rounded-top-1{border-top-left-radius:var(--bs-border-radius-sm)!important;border-top-right-radius:var(--bs-border-radius-sm)!important}.rounded-top-2{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-top-3{border-top-left-radius:var(--bs-border-radius-lg)!important;border-top-right-radius:var(--bs-border-radius-lg)!important}.rounded-top-4{border-top-left-radius:var(--bs-border-radius-xl)!important;border-top-right-radius:var(--bs-border-radius-xl)!important}.rounded-top-5{border-top-left-radius:var(--bs-border-radius-xxl)!important;border-top-right-radius:var(--bs-border-radius-xxl)!important}.rounded-top-circle{border-top-left-radius:50%!important;border-top-right-radius:50%!important}.rounded-top-pill{border-top-left-radius:var(--bs-border-radius-pill)!important;border-top-right-radius:var(--bs-border-radius-pill)!important}.rounded-end{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-end-0{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.rounded-end-1{border-top-right-radius:var(--bs-border-radius-sm)!important;border-bottom-right-radius:var(--bs-border-radius-sm)!important}.rounded-end-2{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-end-3{border-top-right-radius:var(--bs-border-radius-lg)!important;border-bottom-right-radius:var(--bs-border-radius-lg)!important}.rounded-end-4{border-top-right-radius:var(--bs-border-radius-xl)!important;border-bottom-right-radius:var(--bs-border-radius-xl)!important}.rounded-end-5{border-top-right-radius:var(--bs-border-radius-xxl)!important;border-bottom-right-radius:var(--bs-border-radius-xxl)!important}.rounded-end-circle{border-top-right-radius:50%!important;border-bottom-right-radius:50%!important}.rounded-end-pill{border-top-right-radius:var(--bs-border-radius-pill)!important;border-bottom-right-radius:var(--bs-border-radius-pill)!important}.rounded-bottom{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-bottom-0{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.rounded-bottom-1{border-bottom-right-radius:var(--bs-border-radius-sm)!important;border-bottom-left-radius:var(--bs-border-radius-sm)!important}.rounded-bottom-2{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-bottom-3{border-bottom-right-radius:var(--bs-border-radius-lg)!important;border-bottom-left-radius:var(--bs-border-radius-lg)!important}.rounded-bottom-4{border-bottom-right-radius:var(--bs-border-radius-xl)!important;border-bottom-left-radius:var(--bs-border-radius-xl)!important}.rounded-bottom-5{border-bottom-right-radius:var(--bs-border-radius-xxl)!important;border-bottom-left-radius:var(--bs-border-radius-xxl)!important}.rounded-bottom-circle{border-bottom-right-radius:50%!important;border-bottom-left-radius:50%!important}.rounded-bottom-pill{border-bottom-right-radius:var(--bs-border-radius-pill)!important;border-bottom-left-radius:var(--bs-border-radius-pill)!important}.rounded-start{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.rounded-start-0{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.rounded-start-1{border-bottom-left-radius:var(--bs-border-radius-sm)!important;border-top-left-radius:var(--bs-border-radius-sm)!important}.rounded-start-2{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.rounded-start-3{border-bottom-left-radius:var(--bs-border-radius-lg)!important;border-top-left-radius:var(--bs-border-radius-lg)!important}.rounded-start-4{border-bottom-left-radius:var(--bs-border-radius-xl)!important;border-top-left-radius:var(--bs-border-radius-xl)!important}.rounded-start-5{border-bottom-left-radius:var(--bs-border-radius-xxl)!important;border-top-left-radius:var(--bs-border-radius-xxl)!important}.rounded-start-circle{border-bottom-left-radius:50%!important;border-top-left-radius:50%!important}.rounded-start-pill{border-bottom-left-radius:var(--bs-border-radius-pill)!important;border-top-left-radius:var(--bs-border-radius-pill)!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}.z-n1{z-index:-1!important}.z-0{z-index:0!important}.z-1{z-index:1!important}.z-2{z-index:2!important}.z-3{z-index:3!important}@media (min-width:576px){.float-sm-start{float:left!important}.float-sm-end{float:right!important}.float-sm-none{float:none!important}.object-fit-sm-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-fit-sm-cover{-o-object-fit:cover!important;object-fit:cover!important}.object-fit-sm-fill{-o-object-fit:fill!important;object-fit:fill!important}.object-fit-sm-scale{-o-object-fit:scale-down!important;object-fit:scale-down!important}.object-fit-sm-none{-o-object-fit:none!important;object-fit:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-grid{display:grid!important}.d-sm-inline-grid{display:inline-grid!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}.d-sm-none{display:none!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.justify-content-sm-evenly{justify-content:space-evenly!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.order-sm-first{order:-1!important}.order-sm-0{order:0!important}.order-sm-1{order:1!important}.order-sm-2{order:2!important}.order-sm-3{order:3!important}.order-sm-4{order:4!important}.order-sm-5{order:5!important}.order-sm-last{order:6!important}.m-sm-0{margin:0!important}.m-sm-1{margin:.25rem!important}.m-sm-2{margin:.5rem!important}.m-sm-3{margin:1rem!important}.m-sm-4{margin:1.5rem!important}.m-sm-5{margin:3rem!important}.m-sm-auto{margin:auto!important}.mx-sm-0{margin-right:0!important;margin-left:0!important}.mx-sm-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-sm-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-sm-3{margin-right:1rem!important;margin-left:1rem!important}.mx-sm-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-sm-5{margin-right:3rem!important;margin-left:3rem!important}.mx-sm-auto{margin-right:auto!important;margin-left:auto!important}.my-sm-0{margin-top:0!important;margin-bottom:0!important}.my-sm-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-sm-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-sm-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-sm-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-sm-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-sm-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-sm-0{margin-top:0!important}.mt-sm-1{margin-top:.25rem!important}.mt-sm-2{margin-top:.5rem!important}.mt-sm-3{margin-top:1rem!important}.mt-sm-4{margin-top:1.5rem!important}.mt-sm-5{margin-top:3rem!important}.mt-sm-auto{margin-top:auto!important}.me-sm-0{margin-right:0!important}.me-sm-1{margin-right:.25rem!important}.me-sm-2{margin-right:.5rem!important}.me-sm-3{margin-right:1rem!important}.me-sm-4{margin-right:1.5rem!important}.me-sm-5{margin-right:3rem!important}.me-sm-auto{margin-right:auto!important}.mb-sm-0{margin-bottom:0!important}.mb-sm-1{margin-bottom:.25rem!important}.mb-sm-2{margin-bottom:.5rem!important}.mb-sm-3{margin-bottom:1rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.mb-sm-5{margin-bottom:3rem!important}.mb-sm-auto{margin-bottom:auto!important}.ms-sm-0{margin-left:0!important}.ms-sm-1{margin-left:.25rem!important}.ms-sm-2{margin-left:.5rem!important}.ms-sm-3{margin-left:1rem!important}.ms-sm-4{margin-left:1.5rem!important}.ms-sm-5{margin-left:3rem!important}.ms-sm-auto{margin-left:auto!important}.p-sm-0{padding:0!important}.p-sm-1{padding:.25rem!important}.p-sm-2{padding:.5rem!important}.p-sm-3{padding:1rem!important}.p-sm-4{padding:1.5rem!important}.p-sm-5{padding:3rem!important}.px-sm-0{padding-right:0!important;padding-left:0!important}.px-sm-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-sm-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-sm-3{padding-right:1rem!important;padding-left:1rem!important}.px-sm-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-sm-5{padding-right:3rem!important;padding-left:3rem!important}.py-sm-0{padding-top:0!important;padding-bottom:0!important}.py-sm-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-sm-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-sm-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-sm-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-sm-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-sm-0{padding-top:0!important}.pt-sm-1{padding-top:.25rem!important}.pt-sm-2{padding-top:.5rem!important}.pt-sm-3{padding-top:1rem!important}.pt-sm-4{padding-top:1.5rem!important}.pt-sm-5{padding-top:3rem!important}.pe-sm-0{padding-right:0!important}.pe-sm-1{padding-right:.25rem!important}.pe-sm-2{padding-right:.5rem!important}.pe-sm-3{padding-right:1rem!important}.pe-sm-4{padding-right:1.5rem!important}.pe-sm-5{padding-right:3rem!important}.pb-sm-0{padding-bottom:0!important}.pb-sm-1{padding-bottom:.25rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pb-sm-3{padding-bottom:1rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pb-sm-5{padding-bottom:3rem!important}.ps-sm-0{padding-left:0!important}.ps-sm-1{padding-left:.25rem!important}.ps-sm-2{padding-left:.5rem!important}.ps-sm-3{padding-left:1rem!important}.ps-sm-4{padding-left:1.5rem!important}.ps-sm-5{padding-left:3rem!important}.gap-sm-0{gap:0!important}.gap-sm-1{gap:.25rem!important}.gap-sm-2{gap:.5rem!important}.gap-sm-3{gap:1rem!important}.gap-sm-4{gap:1.5rem!important}.gap-sm-5{gap:3rem!important}.row-gap-sm-0{row-gap:0!important}.row-gap-sm-1{row-gap:.25rem!important}.row-gap-sm-2{row-gap:.5rem!important}.row-gap-sm-3{row-gap:1rem!important}.row-gap-sm-4{row-gap:1.5rem!important}.row-gap-sm-5{row-gap:3rem!important}.column-gap-sm-0{-moz-column-gap:0!important;column-gap:0!important}.column-gap-sm-1{-moz-column-gap:0.25rem!important;column-gap:.25rem!important}.column-gap-sm-2{-moz-column-gap:0.5rem!important;column-gap:.5rem!important}.column-gap-sm-3{-moz-column-gap:1rem!important;column-gap:1rem!important}.column-gap-sm-4{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.column-gap-sm-5{-moz-column-gap:3rem!important;column-gap:3rem!important}.text-sm-start{text-align:left!important}.text-sm-end{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.float-md-start{float:left!important}.float-md-end{float:right!important}.float-md-none{float:none!important}.object-fit-md-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-fit-md-cover{-o-object-fit:cover!important;object-fit:cover!important}.object-fit-md-fill{-o-object-fit:fill!important;object-fit:fill!important}.object-fit-md-scale{-o-object-fit:scale-down!important;object-fit:scale-down!important}.object-fit-md-none{-o-object-fit:none!important;object-fit:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-grid{display:grid!important}.d-md-inline-grid{display:inline-grid!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}.d-md-none{display:none!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.justify-content-md-evenly{justify-content:space-evenly!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.order-md-first{order:-1!important}.order-md-0{order:0!important}.order-md-1{order:1!important}.order-md-2{order:2!important}.order-md-3{order:3!important}.order-md-4{order:4!important}.order-md-5{order:5!important}.order-md-last{order:6!important}.m-md-0{margin:0!important}.m-md-1{margin:.25rem!important}.m-md-2{margin:.5rem!important}.m-md-3{margin:1rem!important}.m-md-4{margin:1.5rem!important}.m-md-5{margin:3rem!important}.m-md-auto{margin:auto!important}.mx-md-0{margin-right:0!important;margin-left:0!important}.mx-md-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-md-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-md-3{margin-right:1rem!important;margin-left:1rem!important}.mx-md-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-md-5{margin-right:3rem!important;margin-left:3rem!important}.mx-md-auto{margin-right:auto!important;margin-left:auto!important}.my-md-0{margin-top:0!important;margin-bottom:0!important}.my-md-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-md-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-md-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-md-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-md-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-md-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-md-0{margin-top:0!important}.mt-md-1{margin-top:.25rem!important}.mt-md-2{margin-top:.5rem!important}.mt-md-3{margin-top:1rem!important}.mt-md-4{margin-top:1.5rem!important}.mt-md-5{margin-top:3rem!important}.mt-md-auto{margin-top:auto!important}.me-md-0{margin-right:0!important}.me-md-1{margin-right:.25rem!important}.me-md-2{margin-right:.5rem!important}.me-md-3{margin-right:1rem!important}.me-md-4{margin-right:1.5rem!important}.me-md-5{margin-right:3rem!important}.me-md-auto{margin-right:auto!important}.mb-md-0{margin-bottom:0!important}.mb-md-1{margin-bottom:.25rem!important}.mb-md-2{margin-bottom:.5rem!important}.mb-md-3{margin-bottom:1rem!important}.mb-md-4{margin-bottom:1.5rem!important}.mb-md-5{margin-bottom:3rem!important}.mb-md-auto{margin-bottom:auto!important}.ms-md-0{margin-left:0!important}.ms-md-1{margin-left:.25rem!important}.ms-md-2{margin-left:.5rem!important}.ms-md-3{margin-left:1rem!important}.ms-md-4{margin-left:1.5rem!important}.ms-md-5{margin-left:3rem!important}.ms-md-auto{margin-left:auto!important}.p-md-0{padding:0!important}.p-md-1{padding:.25rem!important}.p-md-2{padding:.5rem!important}.p-md-3{padding:1rem!important}.p-md-4{padding:1.5rem!important}.p-md-5{padding:3rem!important}.px-md-0{padding-right:0!important;padding-left:0!important}.px-md-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-md-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-md-3{padding-right:1rem!important;padding-left:1rem!important}.px-md-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-md-5{padding-right:3rem!important;padding-left:3rem!important}.py-md-0{padding-top:0!important;padding-bottom:0!important}.py-md-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-md-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-md-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-md-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-md-0{padding-top:0!important}.pt-md-1{padding-top:.25rem!important}.pt-md-2{padding-top:.5rem!important}.pt-md-3{padding-top:1rem!important}.pt-md-4{padding-top:1.5rem!important}.pt-md-5{padding-top:3rem!important}.pe-md-0{padding-right:0!important}.pe-md-1{padding-right:.25rem!important}.pe-md-2{padding-right:.5rem!important}.pe-md-3{padding-right:1rem!important}.pe-md-4{padding-right:1.5rem!important}.pe-md-5{padding-right:3rem!important}.pb-md-0{padding-bottom:0!important}.pb-md-1{padding-bottom:.25rem!important}.pb-md-2{padding-bottom:.5rem!important}.pb-md-3{padding-bottom:1rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pb-md-5{padding-bottom:3rem!important}.ps-md-0{padding-left:0!important}.ps-md-1{padding-left:.25rem!important}.ps-md-2{padding-left:.5rem!important}.ps-md-3{padding-left:1rem!important}.ps-md-4{padding-left:1.5rem!important}.ps-md-5{padding-left:3rem!important}.gap-md-0{gap:0!important}.gap-md-1{gap:.25rem!important}.gap-md-2{gap:.5rem!important}.gap-md-3{gap:1rem!important}.gap-md-4{gap:1.5rem!important}.gap-md-5{gap:3rem!important}.row-gap-md-0{row-gap:0!important}.row-gap-md-1{row-gap:.25rem!important}.row-gap-md-2{row-gap:.5rem!important}.row-gap-md-3{row-gap:1rem!important}.row-gap-md-4{row-gap:1.5rem!important}.row-gap-md-5{row-gap:3rem!important}.column-gap-md-0{-moz-column-gap:0!important;column-gap:0!important}.column-gap-md-1{-moz-column-gap:0.25rem!important;column-gap:.25rem!important}.column-gap-md-2{-moz-column-gap:0.5rem!important;column-gap:.5rem!important}.column-gap-md-3{-moz-column-gap:1rem!important;column-gap:1rem!important}.column-gap-md-4{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.column-gap-md-5{-moz-column-gap:3rem!important;column-gap:3rem!important}.text-md-start{text-align:left!important}.text-md-end{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.float-lg-start{float:left!important}.float-lg-end{float:right!important}.float-lg-none{float:none!important}.object-fit-lg-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-fit-lg-cover{-o-object-fit:cover!important;object-fit:cover!important}.object-fit-lg-fill{-o-object-fit:fill!important;object-fit:fill!important}.object-fit-lg-scale{-o-object-fit:scale-down!important;object-fit:scale-down!important}.object-fit-lg-none{-o-object-fit:none!important;object-fit:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-grid{display:grid!important}.d-lg-inline-grid{display:inline-grid!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}.d-lg-none{display:none!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.justify-content-lg-evenly{justify-content:space-evenly!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.order-lg-first{order:-1!important}.order-lg-0{order:0!important}.order-lg-1{order:1!important}.order-lg-2{order:2!important}.order-lg-3{order:3!important}.order-lg-4{order:4!important}.order-lg-5{order:5!important}.order-lg-last{order:6!important}.m-lg-0{margin:0!important}.m-lg-1{margin:.25rem!important}.m-lg-2{margin:.5rem!important}.m-lg-3{margin:1rem!important}.m-lg-4{margin:1.5rem!important}.m-lg-5{margin:3rem!important}.m-lg-auto{margin:auto!important}.mx-lg-0{margin-right:0!important;margin-left:0!important}.mx-lg-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-lg-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-lg-3{margin-right:1rem!important;margin-left:1rem!important}.mx-lg-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-lg-5{margin-right:3rem!important;margin-left:3rem!important}.mx-lg-auto{margin-right:auto!important;margin-left:auto!important}.my-lg-0{margin-top:0!important;margin-bottom:0!important}.my-lg-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-lg-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-lg-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-lg-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-lg-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-lg-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-lg-0{margin-top:0!important}.mt-lg-1{margin-top:.25rem!important}.mt-lg-2{margin-top:.5rem!important}.mt-lg-3{margin-top:1rem!important}.mt-lg-4{margin-top:1.5rem!important}.mt-lg-5{margin-top:3rem!important}.mt-lg-auto{margin-top:auto!important}.me-lg-0{margin-right:0!important}.me-lg-1{margin-right:.25rem!important}.me-lg-2{margin-right:.5rem!important}.me-lg-3{margin-right:1rem!important}.me-lg-4{margin-right:1.5rem!important}.me-lg-5{margin-right:3rem!important}.me-lg-auto{margin-right:auto!important}.mb-lg-0{margin-bottom:0!important}.mb-lg-1{margin-bottom:.25rem!important}.mb-lg-2{margin-bottom:.5rem!important}.mb-lg-3{margin-bottom:1rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.mb-lg-5{margin-bottom:3rem!important}.mb-lg-auto{margin-bottom:auto!important}.ms-lg-0{margin-left:0!important}.ms-lg-1{margin-left:.25rem!important}.ms-lg-2{margin-left:.5rem!important}.ms-lg-3{margin-left:1rem!important}.ms-lg-4{margin-left:1.5rem!important}.ms-lg-5{margin-left:3rem!important}.ms-lg-auto{margin-left:auto!important}.p-lg-0{padding:0!important}.p-lg-1{padding:.25rem!important}.p-lg-2{padding:.5rem!important}.p-lg-3{padding:1rem!important}.p-lg-4{padding:1.5rem!important}.p-lg-5{padding:3rem!important}.px-lg-0{padding-right:0!important;padding-left:0!important}.px-lg-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-lg-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-lg-3{padding-right:1rem!important;padding-left:1rem!important}.px-lg-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-lg-5{padding-right:3rem!important;padding-left:3rem!important}.py-lg-0{padding-top:0!important;padding-bottom:0!important}.py-lg-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-lg-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-lg-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-lg-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-lg-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-lg-0{padding-top:0!important}.pt-lg-1{padding-top:.25rem!important}.pt-lg-2{padding-top:.5rem!important}.pt-lg-3{padding-top:1rem!important}.pt-lg-4{padding-top:1.5rem!important}.pt-lg-5{padding-top:3rem!important}.pe-lg-0{padding-right:0!important}.pe-lg-1{padding-right:.25rem!important}.pe-lg-2{padding-right:.5rem!important}.pe-lg-3{padding-right:1rem!important}.pe-lg-4{padding-right:1.5rem!important}.pe-lg-5{padding-right:3rem!important}.pb-lg-0{padding-bottom:0!important}.pb-lg-1{padding-bottom:.25rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pb-lg-3{padding-bottom:1rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pb-lg-5{padding-bottom:3rem!important}.ps-lg-0{padding-left:0!important}.ps-lg-1{padding-left:.25rem!important}.ps-lg-2{padding-left:.5rem!important}.ps-lg-3{padding-left:1rem!important}.ps-lg-4{padding-left:1.5rem!important}.ps-lg-5{padding-left:3rem!important}.gap-lg-0{gap:0!important}.gap-lg-1{gap:.25rem!important}.gap-lg-2{gap:.5rem!important}.gap-lg-3{gap:1rem!important}.gap-lg-4{gap:1.5rem!important}.gap-lg-5{gap:3rem!important}.row-gap-lg-0{row-gap:0!important}.row-gap-lg-1{row-gap:.25rem!important}.row-gap-lg-2{row-gap:.5rem!important}.row-gap-lg-3{row-gap:1rem!important}.row-gap-lg-4{row-gap:1.5rem!important}.row-gap-lg-5{row-gap:3rem!important}.column-gap-lg-0{-moz-column-gap:0!important;column-gap:0!important}.column-gap-lg-1{-moz-column-gap:0.25rem!important;column-gap:.25rem!important}.column-gap-lg-2{-moz-column-gap:0.5rem!important;column-gap:.5rem!important}.column-gap-lg-3{-moz-column-gap:1rem!important;column-gap:1rem!important}.column-gap-lg-4{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.column-gap-lg-5{-moz-column-gap:3rem!important;column-gap:3rem!important}.text-lg-start{text-align:left!important}.text-lg-end{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.float-xl-start{float:left!important}.float-xl-end{float:right!important}.float-xl-none{float:none!important}.object-fit-xl-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-fit-xl-cover{-o-object-fit:cover!important;object-fit:cover!important}.object-fit-xl-fill{-o-object-fit:fill!important;object-fit:fill!important}.object-fit-xl-scale{-o-object-fit:scale-down!important;object-fit:scale-down!important}.object-fit-xl-none{-o-object-fit:none!important;object-fit:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-grid{display:grid!important}.d-xl-inline-grid{display:inline-grid!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}.d-xl-none{display:none!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.justify-content-xl-evenly{justify-content:space-evenly!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.order-xl-first{order:-1!important}.order-xl-0{order:0!important}.order-xl-1{order:1!important}.order-xl-2{order:2!important}.order-xl-3{order:3!important}.order-xl-4{order:4!important}.order-xl-5{order:5!important}.order-xl-last{order:6!important}.m-xl-0{margin:0!important}.m-xl-1{margin:.25rem!important}.m-xl-2{margin:.5rem!important}.m-xl-3{margin:1rem!important}.m-xl-4{margin:1.5rem!important}.m-xl-5{margin:3rem!important}.m-xl-auto{margin:auto!important}.mx-xl-0{margin-right:0!important;margin-left:0!important}.mx-xl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xl-auto{margin-right:auto!important;margin-left:auto!important}.my-xl-0{margin-top:0!important;margin-bottom:0!important}.my-xl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xl-0{margin-top:0!important}.mt-xl-1{margin-top:.25rem!important}.mt-xl-2{margin-top:.5rem!important}.mt-xl-3{margin-top:1rem!important}.mt-xl-4{margin-top:1.5rem!important}.mt-xl-5{margin-top:3rem!important}.mt-xl-auto{margin-top:auto!important}.me-xl-0{margin-right:0!important}.me-xl-1{margin-right:.25rem!important}.me-xl-2{margin-right:.5rem!important}.me-xl-3{margin-right:1rem!important}.me-xl-4{margin-right:1.5rem!important}.me-xl-5{margin-right:3rem!important}.me-xl-auto{margin-right:auto!important}.mb-xl-0{margin-bottom:0!important}.mb-xl-1{margin-bottom:.25rem!important}.mb-xl-2{margin-bottom:.5rem!important}.mb-xl-3{margin-bottom:1rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.mb-xl-5{margin-bottom:3rem!important}.mb-xl-auto{margin-bottom:auto!important}.ms-xl-0{margin-left:0!important}.ms-xl-1{margin-left:.25rem!important}.ms-xl-2{margin-left:.5rem!important}.ms-xl-3{margin-left:1rem!important}.ms-xl-4{margin-left:1.5rem!important}.ms-xl-5{margin-left:3rem!important}.ms-xl-auto{margin-left:auto!important}.p-xl-0{padding:0!important}.p-xl-1{padding:.25rem!important}.p-xl-2{padding:.5rem!important}.p-xl-3{padding:1rem!important}.p-xl-4{padding:1.5rem!important}.p-xl-5{padding:3rem!important}.px-xl-0{padding-right:0!important;padding-left:0!important}.px-xl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xl-0{padding-top:0!important;padding-bottom:0!important}.py-xl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xl-0{padding-top:0!important}.pt-xl-1{padding-top:.25rem!important}.pt-xl-2{padding-top:.5rem!important}.pt-xl-3{padding-top:1rem!important}.pt-xl-4{padding-top:1.5rem!important}.pt-xl-5{padding-top:3rem!important}.pe-xl-0{padding-right:0!important}.pe-xl-1{padding-right:.25rem!important}.pe-xl-2{padding-right:.5rem!important}.pe-xl-3{padding-right:1rem!important}.pe-xl-4{padding-right:1.5rem!important}.pe-xl-5{padding-right:3rem!important}.pb-xl-0{padding-bottom:0!important}.pb-xl-1{padding-bottom:.25rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pb-xl-3{padding-bottom:1rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pb-xl-5{padding-bottom:3rem!important}.ps-xl-0{padding-left:0!important}.ps-xl-1{padding-left:.25rem!important}.ps-xl-2{padding-left:.5rem!important}.ps-xl-3{padding-left:1rem!important}.ps-xl-4{padding-left:1.5rem!important}.ps-xl-5{padding-left:3rem!important}.gap-xl-0{gap:0!important}.gap-xl-1{gap:.25rem!important}.gap-xl-2{gap:.5rem!important}.gap-xl-3{gap:1rem!important}.gap-xl-4{gap:1.5rem!important}.gap-xl-5{gap:3rem!important}.row-gap-xl-0{row-gap:0!important}.row-gap-xl-1{row-gap:.25rem!important}.row-gap-xl-2{row-gap:.5rem!important}.row-gap-xl-3{row-gap:1rem!important}.row-gap-xl-4{row-gap:1.5rem!important}.row-gap-xl-5{row-gap:3rem!important}.column-gap-xl-0{-moz-column-gap:0!important;column-gap:0!important}.column-gap-xl-1{-moz-column-gap:0.25rem!important;column-gap:.25rem!important}.column-gap-xl-2{-moz-column-gap:0.5rem!important;column-gap:.5rem!important}.column-gap-xl-3{-moz-column-gap:1rem!important;column-gap:1rem!important}.column-gap-xl-4{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.column-gap-xl-5{-moz-column-gap:3rem!important;column-gap:3rem!important}.text-xl-start{text-align:left!important}.text-xl-end{text-align:right!important}.text-xl-center{text-align:center!important}}@media (min-width:1400px){.float-xxl-start{float:left!important}.float-xxl-end{float:right!important}.float-xxl-none{float:none!important}.object-fit-xxl-contain{-o-object-fit:contain!important;object-fit:contain!important}.object-fit-xxl-cover{-o-object-fit:cover!important;object-fit:cover!important}.object-fit-xxl-fill{-o-object-fit:fill!important;object-fit:fill!important}.object-fit-xxl-scale{-o-object-fit:scale-down!important;object-fit:scale-down!important}.object-fit-xxl-none{-o-object-fit:none!important;object-fit:none!important}.d-xxl-inline{display:inline!important}.d-xxl-inline-block{display:inline-block!important}.d-xxl-block{display:block!important}.d-xxl-grid{display:grid!important}.d-xxl-inline-grid{display:inline-grid!important}.d-xxl-table{display:table!important}.d-xxl-table-row{display:table-row!important}.d-xxl-table-cell{display:table-cell!important}.d-xxl-flex{display:flex!important}.d-xxl-inline-flex{display:inline-flex!important}.d-xxl-none{display:none!important}.flex-xxl-fill{flex:1 1 auto!important}.flex-xxl-row{flex-direction:row!important}.flex-xxl-column{flex-direction:column!important}.flex-xxl-row-reverse{flex-direction:row-reverse!important}.flex-xxl-column-reverse{flex-direction:column-reverse!important}.flex-xxl-grow-0{flex-grow:0!important}.flex-xxl-grow-1{flex-grow:1!important}.flex-xxl-shrink-0{flex-shrink:0!important}.flex-xxl-shrink-1{flex-shrink:1!important}.flex-xxl-wrap{flex-wrap:wrap!important}.flex-xxl-nowrap{flex-wrap:nowrap!important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xxl-start{justify-content:flex-start!important}.justify-content-xxl-end{justify-content:flex-end!important}.justify-content-xxl-center{justify-content:center!important}.justify-content-xxl-between{justify-content:space-between!important}.justify-content-xxl-around{justify-content:space-around!important}.justify-content-xxl-evenly{justify-content:space-evenly!important}.align-items-xxl-start{align-items:flex-start!important}.align-items-xxl-end{align-items:flex-end!important}.align-items-xxl-center{align-items:center!important}.align-items-xxl-baseline{align-items:baseline!important}.align-items-xxl-stretch{align-items:stretch!important}.align-content-xxl-start{align-content:flex-start!important}.align-content-xxl-end{align-content:flex-end!important}.align-content-xxl-center{align-content:center!important}.align-content-xxl-between{align-content:space-between!important}.align-content-xxl-around{align-content:space-around!important}.align-content-xxl-stretch{align-content:stretch!important}.align-self-xxl-auto{align-self:auto!important}.align-self-xxl-start{align-self:flex-start!important}.align-self-xxl-end{align-self:flex-end!important}.align-self-xxl-center{align-self:center!important}.align-self-xxl-baseline{align-self:baseline!important}.align-self-xxl-stretch{align-self:stretch!important}.order-xxl-first{order:-1!important}.order-xxl-0{order:0!important}.order-xxl-1{order:1!important}.order-xxl-2{order:2!important}.order-xxl-3{order:3!important}.order-xxl-4{order:4!important}.order-xxl-5{order:5!important}.order-xxl-last{order:6!important}.m-xxl-0{margin:0!important}.m-xxl-1{margin:.25rem!important}.m-xxl-2{margin:.5rem!important}.m-xxl-3{margin:1rem!important}.m-xxl-4{margin:1.5rem!important}.m-xxl-5{margin:3rem!important}.m-xxl-auto{margin:auto!important}.mx-xxl-0{margin-right:0!important;margin-left:0!important}.mx-xxl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xxl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xxl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xxl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xxl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xxl-auto{margin-right:auto!important;margin-left:auto!important}.my-xxl-0{margin-top:0!important;margin-bottom:0!important}.my-xxl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xxl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xxl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xxl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xxl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xxl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xxl-0{margin-top:0!important}.mt-xxl-1{margin-top:.25rem!important}.mt-xxl-2{margin-top:.5rem!important}.mt-xxl-3{margin-top:1rem!important}.mt-xxl-4{margin-top:1.5rem!important}.mt-xxl-5{margin-top:3rem!important}.mt-xxl-auto{margin-top:auto!important}.me-xxl-0{margin-right:0!important}.me-xxl-1{margin-right:.25rem!important}.me-xxl-2{margin-right:.5rem!important}.me-xxl-3{margin-right:1rem!important}.me-xxl-4{margin-right:1.5rem!important}.me-xxl-5{margin-right:3rem!important}.me-xxl-auto{margin-right:auto!important}.mb-xxl-0{margin-bottom:0!important}.mb-xxl-1{margin-bottom:.25rem!important}.mb-xxl-2{margin-bottom:.5rem!important}.mb-xxl-3{margin-bottom:1rem!important}.mb-xxl-4{margin-bottom:1.5rem!important}.mb-xxl-5{margin-bottom:3rem!important}.mb-xxl-auto{margin-bottom:auto!important}.ms-xxl-0{margin-left:0!important}.ms-xxl-1{margin-left:.25rem!important}.ms-xxl-2{margin-left:.5rem!important}.ms-xxl-3{margin-left:1rem!important}.ms-xxl-4{margin-left:1.5rem!important}.ms-xxl-5{margin-left:3rem!important}.ms-xxl-auto{margin-left:auto!important}.p-xxl-0{padding:0!important}.p-xxl-1{padding:.25rem!important}.p-xxl-2{padding:.5rem!important}.p-xxl-3{padding:1rem!important}.p-xxl-4{padding:1.5rem!important}.p-xxl-5{padding:3rem!important}.px-xxl-0{padding-right:0!important;padding-left:0!important}.px-xxl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xxl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xxl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xxl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xxl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xxl-0{padding-top:0!important;padding-bottom:0!important}.py-xxl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xxl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xxl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xxl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xxl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xxl-0{padding-top:0!important}.pt-xxl-1{padding-top:.25rem!important}.pt-xxl-2{padding-top:.5rem!important}.pt-xxl-3{padding-top:1rem!important}.pt-xxl-4{padding-top:1.5rem!important}.pt-xxl-5{padding-top:3rem!important}.pe-xxl-0{padding-right:0!important}.pe-xxl-1{padding-right:.25rem!important}.pe-xxl-2{padding-right:.5rem!important}.pe-xxl-3{padding-right:1rem!important}.pe-xxl-4{padding-right:1.5rem!important}.pe-xxl-5{padding-right:3rem!important}.pb-xxl-0{padding-bottom:0!important}.pb-xxl-1{padding-bottom:.25rem!important}.pb-xxl-2{padding-bottom:.5rem!important}.pb-xxl-3{padding-bottom:1rem!important}.pb-xxl-4{padding-bottom:1.5rem!important}.pb-xxl-5{padding-bottom:3rem!important}.ps-xxl-0{padding-left:0!important}.ps-xxl-1{padding-left:.25rem!important}.ps-xxl-2{padding-left:.5rem!important}.ps-xxl-3{padding-left:1rem!important}.ps-xxl-4{padding-left:1.5rem!important}.ps-xxl-5{padding-left:3rem!important}.gap-xxl-0{gap:0!important}.gap-xxl-1{gap:.25rem!important}.gap-xxl-2{gap:.5rem!important}.gap-xxl-3{gap:1rem!important}.gap-xxl-4{gap:1.5rem!important}.gap-xxl-5{gap:3rem!important}.row-gap-xxl-0{row-gap:0!important}.row-gap-xxl-1{row-gap:.25rem!important}.row-gap-xxl-2{row-gap:.5rem!important}.row-gap-xxl-3{row-gap:1rem!important}.row-gap-xxl-4{row-gap:1.5rem!important}.row-gap-xxl-5{row-gap:3rem!important}.column-gap-xxl-0{-moz-column-gap:0!important;column-gap:0!important}.column-gap-xxl-1{-moz-column-gap:0.25rem!important;column-gap:.25rem!important}.column-gap-xxl-2{-moz-column-gap:0.5rem!important;column-gap:.5rem!important}.column-gap-xxl-3{-moz-column-gap:1rem!important;column-gap:1rem!important}.column-gap-xxl-4{-moz-column-gap:1.5rem!important;column-gap:1.5rem!important}.column-gap-xxl-5{-moz-column-gap:3rem!important;column-gap:3rem!important}.text-xxl-start{text-align:left!important}.text-xxl-end{text-align:right!important}.text-xxl-center{text-align:center!important}}@media (min-width:1200px){.fs-1{font-size:2.5rem!important}.fs-2{font-size:2rem!important}.fs-3{font-size:1.75rem!important}.fs-4{font-size:1.5rem!important}}@media print{.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-grid{display:grid!important}.d-print-inline-grid{display:inline-grid!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}.d-print-none{display:none!important}} +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(./fonts/glyphicons-halflings-regular.eot);src:url(./fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(./fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(./fonts/glyphicons-halflings-regular.woff) format('woff'),url(./fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(./fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} /*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/examples/libs/color-modes.js b/examples/libs/color-modes.js deleted file mode 100644 index bb2f4ec..0000000 --- a/examples/libs/color-modes.js +++ /dev/null @@ -1,80 +0,0 @@ -/*! - * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) - * Copyright 2011-2025 The Bootstrap Authors - * Licensed under the Creative Commons Attribution 3.0 Unported License. - */ - -(() => { - 'use strict' - - const getStoredTheme = () => localStorage.getItem('theme') - const setStoredTheme = theme => localStorage.setItem('theme', theme) - - const getPreferredTheme = () => { - const storedTheme = getStoredTheme() - if (storedTheme) { - return storedTheme - } - - return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' - } - - const setTheme = theme => { - if (theme === 'auto') { - document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) - } else { - document.documentElement.setAttribute('data-bs-theme', theme) - } - } - - setTheme(getPreferredTheme()) - - const showActiveTheme = (theme, focus = false) => { - const themeSwitcher = document.querySelector('#bd-theme') - - if (!themeSwitcher) { - return - } - - const themeSwitcherText = document.querySelector('#bd-theme-text') - const activeThemeIcon = document.querySelector('.theme-icon-active use') - const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`) - const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href') - - document.querySelectorAll('[data-bs-theme-value]').forEach(element => { - element.classList.remove('active') - element.setAttribute('aria-pressed', 'false') - }) - - btnToActive.classList.add('active') - btnToActive.setAttribute('aria-pressed', 'true') - activeThemeIcon.setAttribute('href', svgOfActiveBtn) - const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})` - themeSwitcher.setAttribute('aria-label', themeSwitcherLabel) - - if (focus) { - themeSwitcher.focus() - } - } - - window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { - const storedTheme = getStoredTheme() - if (storedTheme !== 'light' && storedTheme !== 'dark') { - setTheme(getPreferredTheme()) - } - }) - - window.addEventListener('DOMContentLoaded', () => { - showActiveTheme(getPreferredTheme()) - - document.querySelectorAll('[data-bs-theme-value]') - .forEach(toggle => { - toggle.addEventListener('click', () => { - const theme = toggle.getAttribute('data-bs-theme-value') - setStoredTheme(theme) - setTheme(theme) - showActiveTheme(theme, true) - }) - }) - }) - })() \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/6383409a326255b7@214.js b/examples/observable_examples/from_concept_to_simulation_intro/6383409a326255b7@214.js deleted file mode 100644 index 4abf71a..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/6383409a326255b7@214.js +++ /dev/null @@ -1,99 +0,0 @@ -// https://observablehq.com/@ferrari212/from-the-hull-to-simulation-a-vessel-js-tutorial@214 -function _e1(md){return( -md`# From Concept to Simulation - A [vessel.js](https://github.com/shiplab/vesseljs) tutorial` -)} - -function _e2(md){return( -md`## Felipe Ferrari de Oliveira -Master Graduated in Naval Architecture from Norwegian University of Science and Technology (NTNU)` -)} - -function _e3(md){return( -md`## Introduction - -This tutorial introduces the best practices for using the [vessel.js](https://github.com/shiplab/vesseljs); a JavaScript library for data-driven design combining conceptual ship design with a web-based object-oriented approach. - -The solution is described in H.M. Gaspar's paper: - - [***Vessel.js: an open and collaborative ship design object-oriented library***](https://raw.githubusercontent.com/wiki/shiplab/vesseljs/files/IMDC_preprint.pdf). -` -)} - -function _4(md){return( -md` -As the tutorial progresses, the following design steps will be covered: - -* Detailing a ship general arrangement and lines plan; -* Developing a graphical user interface (GUI) using a system engineering approach; -* Displaying a 3D rendering of the ship hosted on a web platform; -* Explanation about main analysis and simulation models. - -The research ship [Gunnerus](https://www.ntnu.edu/gunnerus) is used as a model in each of the digitalization process steps. - - -` -)} - -function _e5(md){return( -md`## Chapters - -* Chapter 1 - [From Plane Lines to 3D Hull](./chapter-1/index.html) -* Chapter 2 - [From GA to Blocks](./chapter-2/index.html) - + Section 2.1 - [Decks and Bulckheads](./chapter-2/index.html) - + Section 2.2 - [Compartments](./section-2-2/index.html) - + Section 2.3 - [Tanks](./section-2-3/index.html) - + Section 2.4 - [Equipments and STL elements](./section-2-4/index.html) - + Section 2.5 - [Importing External Elements](./section-2-5/index.html) - + Section 2.6 - [Creating a GLTF realistic model](./section-2-6/index.html) -* Chapter 3 - [Principles of System Engineering Applied to Gunnerus](./chapter-3/index.html) - + Section 3.1 - [GUI controller interface - Dropdown menu](./section-3-1/index.html) - + Section 3.2 - [GUI controller interface - Check Box List](./section-3-2/index.html) -* Chapter 4 - [Simulations and Analysis Principles for Vessel.js](./chapter-4/index.html) - + Section 4.1 - [Coordinate Reference System](./section-4-1/index.html) - + Section 4.2 pt.1 - [Advance Resistance Analysis - Propeller Model](./section-4-2) - + Section 4.2 pt.2 - [Advance Resistance Analysis - Resistance Model](./section-4-2-3) - + Section 4.3 - [Advance Resistance Analysis - Resistance Model](./section-4-3) -` -)} - -function _6(md){return( -md`## Contribution - -This project is licensed under the [CC BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/) which in summary states all the project can be shared or adapted, as long a proper attribuition to the original source is given and in case of modification the new project must be lisced under the same conditions as its original. - -You are also invited to contribute with this tutorial by suggesting new recomendations. This tutorial is also subject to evolve according to the modifications in the Vessel.js library. - -` -)} - -function _7(md){return( -md`## Acknowledgment - - - -This project was possible thanks to several partners that helped me to achieve a high standard report. First, I would like to acknowledge the importance of [NTNU](https://www.ntnu.edu/) for financing this project, providing the 3D models and investing in my capacitation as student. This support will definitely help me in my career and contribute to the improvement of technological collaborative solutions. - - - -Seccond, I would like to thank my professor and coordinator [Henrique M. Gaspar](https://www.ntnu.edu/employees/henrique.gaspar) for guiding me through the several tasks I had and for fostering between the students the usage and development of the library [Vessel.js](https://shiplab.github.io/vesseljs/). - - - -The development of this report was also very smooth thanks to the several [examples](https://observablehq.com/collection/@icarofonseca/vessel-js) and snippets provided by [Ícaro Fonseca](https://www.ntnu.no/ansatte/icaro.a.fonseca) and all previews students partners, which together with this report becomes the main guide for [Vessel.js](https://shiplab.github.io/vesseljs/) usage. The leverage potential of the applications provided by this report can be close related not only with the developer partners inside NTNU but also thanks to the huge open source community which this project relies on. - -Finally I would like to acknowledge [Mario Delgado](https://observablehq.com/@mariodelgadosr) for improving [Chapter 1](./chapter-2/index.html) and [Section 2.1](../chapter-2/index.html), making the report more friendly for non maritime professionals and improving the 3D hull visualization. - -` -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer("e1")).define("e1", ["md"], _e1); - main.variable(observer("e2")).define("e2", ["md"], _e2); - main.variable(observer("e3")).define("e3", ["md"], _e3); - main.variable(observer()).define(["md"], _4); - main.variable(observer("e5")).define("e5", ["md"], _e5); - main.variable(observer()).define(["md"], _6); - main.variable(observer()).define(["md"], _7); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/README.md b/examples/observable_examples/from_concept_to_simulation_intro/README.md deleted file mode 100644 index 200305c..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# From Concept to Simulation - A vessel.js tutorial - -https://observablehq.com/@ferrari212/from-the-hull-to-simulation-a-vessel-js-tutorial@214 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/6383409a326255b7@214.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/from-the-hull-to-simulation-a-vessel-js-tutorial"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/6d6823c516e88279@392.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/6d6823c516e88279@392.js deleted file mode 100644 index 3b393e3..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/6d6823c516e88279@392.js +++ /dev/null @@ -1,1918 +0,0 @@ -import define1 from "./715b4c45cc45c3b3@223.js"; -import define2 from "./7764a40fe6b83ca1@437.js"; - -function _1(md){return( -md`# Chapter 1 - From Plane Lines to 3D Hull` -)} - -function _2(md){return( -md`## The Offset Table - -A digital construction of a ship in [vessel.js](https://github.com/shiplab/vesseljs) first starts with a [table of offsets](https://www.sciencedirect.com/topics/engineering/shipyard) that describes the ship's hull. The data for this table in stored in a [JSON](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON) structure. - -In some cases the offset data is unknown or a designer just has a graphical representation of the ship to be modeled. In those scenarios, the table of offsets is developed from a ship line plan.` -)} - -function _3(md){return( -md `### Design State: Extracting Table of Offsets from the Line Plan - -The tutorial's project starts with the *Design State* using the ship's hull curves. - -The following figure shows the main views of [Gunnerus](https://www.ntnu.edu/gunnerus) in [AutoCAD](https://www.autodesk.com/products/autocad/overview). - - -` -)} - -function _4(md){return( -md ` -A 3D rendering application can be used to draw the lines that depict the shape of the ship. - -The following figure represent the 3D visual lines constructed using the [NX](https://en.wikipedia.org/wiki/Siemens_NX) software application. - - - -` -)} - -function _5(md){return( -md ` -The offset data points of the ship are derived from the intersection between the offset lines and the waterlines plane. - - -` -)} - -function _6(md){return( -md ` -The following table represents the offsets ordered by water line and section for [Gunnerus](https://www.ntnu.edu/gunnerus): - - - -As a visualization best practice, it is recommended that "null" value be inserted in the offset table if there's no hull component at a given waterline-station intersection. - -However, in regions between the [bulbus](https://en.wikipedia.org/wiki/Bulbous_bow) and [bow forehead](https://en.wikipedia.org/wiki/Bow_%28ship%29), zeros should be inserted to represent the complete hull. -` -)} - -function _7(md){return( -md `### Creating JSON Object with the Table of Offsets - -With the points elements and the main dimensions of the ship, it is now possible to start providing the data for the *Design State* that will be loaded into the 3D model. - -The base object has the following information: -` -)} - -function _Gunnerus(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": "", - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": "", - "BOA": "", - "Depth": "", - "APP": "", - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": "", - "appendices": {} - }, - "halfBreadths": { - "waterlines": [], - "stations": [], - "table": [] - }, - "style": { - "upperColor": "pink", - "lowerColor": "grey", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - }, - "bulkheads": { - "AB": { - } - } - }, - "baseObjects": [], - - "derivedObjects": [] - -} -)} - -function _9(md){return( -md ` -As this tutorial progresses, the JSON object will be extended with additional information and the intermediary modifiations will be displayed. - -Some of the information required in the Gunnerus object is necessary for the internal spaces on the ship; such as machinery and tanks. This will be addressed in [**Chapter 2**](./chapter-2/index.html) with the discussions on inserting general arrangements. - -The *Design State* represents a configuration for the ship's operation. Therefore, the variables in the JSON object don't model a geometric configuration. - -For the hull's visualization, it is best to change the Draft Design attribute (Gunnerus.designState.calculationParameters.Draft_design) to the maximun -draft permitted. - -For Gunnerus, that value is ***2.787 m***: -` -)} - -function _10(Gunnerus){return( -Gunnerus.designState.calculationParameters.Draft_design = 2.787 -)} - -function _11(md){return( -md ` -All measurements in the table of offsets that are entered into the JSON object are scaled relative to the main dimensions that are found in (Gunnerus.structure.hull.attributes). - -These are: - -* [LOA (Length Overall)](https://en.wikipedia.org/wiki/Ship_measurements) -* [BOA (Beam Overall)](https://en.wikipedia.org/wiki/Ship_measurements) -* [Depth](https://www.britannica.com/topic/depth) -* [APP (After Perpendicular Position)](https://www.sciencedirect.com/topics/engineering/after-perpendicular) -* prismaticLengthRatio: The [length ratio of two prismatic bodies that represent the ship](https://www.sciencedirect.com/science/article/abs/pii/S0029801803001082). - - - -The following assignments are for these main dimensions: -` -)} - -function _12(Gunnerus){return( -Gunnerus.structure.hull.attributes.LOA = 36.25, -Gunnerus.structure.hull.attributes.BOA = 9.6, -Gunnerus.structure.hull.attributes.Depth = 6.6, -Gunnerus.structure.hull.attributes.APP = 2.2, -Gunnerus.structure.hull.attributes.prismaticLengthRatio = 0.6 -)} - -function _13(md,waterlines){return( -md ` -The actual entries in the offset table correspond to [half-breadths](https://www.sciencedirect.com/topics/engineering/shipyard) measurements. - -The first array corresponds to individual water line entries denoting the total depth of the ship; from ${Math.min(...waterlines)} to ${Math.max(...waterlines)}: -` -)} - -function _14(Gunnerus,waterlines){return( -Gunnerus.structure.hull.halfBreadths.waterlines = waterlines -)} - -function _waterlines(){return( -[0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636] -)} - -function _16(md,stations){return( -md ` -The next array represents the individual station locations along the [LOA (Length Overall)](https://en.wikipedia.org/wiki/Ship_measurements); normalized from ${Math.min(...stations)} to ${Math.max(...stations)}: -` -)} - -function _17(Gunnerus,stations){return( -Gunnerus.structure.hull.halfBreadths.stations = stations -)} - -function _stations(){return( -[0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1] -)} - -function _19(md){return( -md ` -Finally, the next array of arrays contains the values in the offset table along its [LOA (Length Overall)](https://en.wikipedia.org/wiki/Ship_measurements). - -For a specific waterline: - -(Gunnerus.structure.hull.halfBreadths.waterlines[i]) - -and a specific station: - -(Gunnerus.structure.hull.halfBreadths.stations[i]) - -the array: - -(Gunnerus.structure.hull.halfBreadths.table[i]) - -contains the normalized half-breadth values along the ship's [LOA (Length Overall)](https://en.wikipedia.org/wiki/Ship_measurements): - -` -)} - -function _20(Gunnerus,halfBreadthTable){return( -Gunnerus.structure.hull.halfBreadths.table = halfBreadthTable -)} - -function _halfBreadthTable(){return( -[ - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.023706, - 0.04164, - 0.03956054, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - null, - null, - null, - null, - null, - null, - null - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.071654682, - 0.218163956, - 0.347109355, - 0.707410528, - 0.7101572, - 0.714521886, - 0.724138946, - 0.749662831, - 0.771743418, - 0.78068812, - 0.777351611, - 0.760040588, - 0.734964599, - 0.707735189, - 0.67881251, - 0.649277089, - 0.619130809, - 0.588445384, - 0.557293752, - 0.525670827, - 0.493631236, - 0.461239013, - 0.428710429, - 0.396118672, - 0.36353124, - 0.331272913, - 0.29936175, - 0.267774887, - 0.236499989, - 0.205527382, - 0.174631462, - 0.143735542, - 0.112839584, - 0.082193712, - 0.05487704, - 0.035077082, - 0.017589529, - 0, - 0, - 0, - null, - null, - null, - null - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.11384365, - 0.28021182, - 0.731167857, - 0.731746877, - 0.733344981, - 0.761914571, - 0.813147939, - 0.852579142, - 0.879895833, - 0.900087484, - 0.914681498, - 0.92643748, - 0.932025146, - 0.935672912, - 0.936216634, - 0.933764547, - 0.928441671, - 0.920420837, - 0.909739482, - 0.894997965, - 0.876045837, - 0.853289591, - 0.827195791, - 0.798289439, - 0.767083232, - 0.733856099, - 0.698899943, - 0.66232254, - 0.6244297, - 0.585758311, - 0.546243642, - 0.506078186, - 0.46566391, - 0.425637487, - 0.386155955, - 0.347200012, - 0.308764165, - 0.270830841, - 0.233397929, - 0.196477089, - 0.160454165, - 0.126395671, - 0.095160357, - 0.062479974, - 0.026483334, - 0, - null, - null, - null - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.11327781, - 0.229017497, - 0.352529385, - 0.726907379, - 0.733153683, - 0.734473511, - 0.777951228, - 0.839199655, - 0.886066097, - 0.918911876, - 0.94205339, - 0.958529154, - 0.970252075, - 0.97813029, - 0.98480835, - 0.986720886, - 0.988820801, - 0.990237529, - 0.987881165, - 0.985799968, - 0.982785339, - 0.978744609, - 0.974802669, - 0.967961121, - 0.957981974, - 0.945835368, - 0.932018738, - 0.914989624, - 0.894104207, - 0.870773824, - 0.844629517, - 0.81436259, - 0.780335897, - 0.743943736, - 0.706508331, - 0.668210297, - 0.627605692, - 0.586681264, - 0.545253652, - 0.503595835, - 0.461675008, - 0.419545822, - 0.380137227, - 0.340914586, - 0.301902084, - 0.26320811, - 0.227077077, - 0.196202088, - 0.165685272, - 0.135260417, - 0.099252084, - 0.034576791, - 0, - null, - null - ], - [ - 0.14752927, - 0.195454496, - 0.252279943, - 0.315177918, - 0.380875676, - 0.453470815, - 0.617983921, - 0.652319055, - 0.685022602, - 0.755220845, - 0.814679074, - 0.864853715, - 0.904683419, - 0.933976734, - 0.955608678, - 0.971806987, - 0.983565004, - 0.991776358, - 0.996810839, - 0.999454025, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0.999147848, - 0.996595208, - 0.994104207, - 0.987329, - 0.979657491, - 0.97008667, - 0.958017375, - 0.943480021, - 0.9264328, - 0.9066745, - 0.883690491, - 0.857092692, - 0.82629715, - 0.791246643, - 0.752603963, - 0.711764526, - 0.669355469, - 0.626193848, - 0.582815806, - 0.53950826, - 0.496612142, - 0.454332225, - 0.412979101, - 0.372598241, - 0.332724024, - 0.293440323, - 0.256938756, - 0.22273585, - 0.192366084, - 0.163749835, - 0.131338641, - 0.075224109, - 0, - null, - null - ], - [ - 0.71273652, - 0.750030161, - 0.785739492, - 0.820259247, - 0.853601583, - 0.884948356, - 0.911901164, - 0.934555335, - 0.953122646, - 0.968269338, - 0.980177623, - 0.989221129, - 0.995597117, - 0.999145458, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000228327, - 0.999831136, - 0.996996663, - 0.991083171, - 0.983481242, - 0.974163818, - 0.962508952, - 0.948075765, - 0.93017568, - 0.908572693, - 0.88319224, - 0.854268494, - 0.821813507, - 0.785829519, - 0.74630839, - 0.70333669, - 0.657443237, - 0.610306346, - 0.562759501, - 0.51533193, - 0.468369497, - 0.422251841, - 0.377271449, - 0.333293279, - 0.290521571, - 0.25025678, - 0.212261035, - 0.176019681, - 0.143433533, - 0.111947466, - 0.036266209, - 0, - null, - null - ], - [ - 0.952335345, - 0.962861851, - 0.972258259, - 0.98050379, - 0.987472892, - 0.992967483, - 0.996992105, - 0.999437767, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000711812, - 1.000223814, - 1.00008331, - 0.998717143, - 0.994425964, - 0.987480367, - 0.977858785, - 0.965194397, - 0.949268189, - 0.930027669, - 0.907345683, - 0.881151021, - 0.851564891, - 0.818550568, - 0.782004293, - 0.74175115, - 0.697687225, - 0.650243429, - 0.60079071, - 0.549806112, - 0.497353109, - 0.443579, - 0.388505936, - 0.332285614, - 0.275121256, - 0.217052256, - 0.158101082, - 0.098297354, - 0.03763231, - 0, - 0, - 0, - null, - null - ], - [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000978704, - 1.000123929, - 1.000433223, - 1.000155476, - 0.999416911, - 0.995501404, - 0.988170878, - 0.977699076, - 0.964266358, - 0.948126119, - 0.929550883, - 0.908355306, - 0.883601888, - 0.854754435, - 0.822345988, - 0.78675532, - 0.747661845, - 0.704622091, - 0.657655182, - 0.607425537, - 0.553840688, - 0.494980367, - 0.430992991, - 0.362582372, - 0.286795248, - 0.1978427, - 0.094251874, - 0, - 0, - 0, - 0, - 0, - null, - null - ], - [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.001068035, - 1, - 1.000566031, - 1.00039981, - 1.000281179, - 0.99947703, - 0.995137939, - 0.987093404, - 0.976328634, - 0.963292135, - 0.948348999, - 0.931424764, - 0.911436564, - 0.887533163, - 0.860225016, - 0.830331319, - 0.797312826, - 0.759774933, - 0.717407786, - 0.670107066, - 0.618719839, - 0.563078613, - 0.499293365, - 0.426550725, - 0.345286535, - 0.254695028, - 0.152289454, - 0.017480884, - 0, - 0, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.001018836, - 1, - 1.000539714, - 1.000450297, - 1.000554231, - 1.000295271, - 0.999729513, - 0.996414083, - 0.989560649, - 0.97963918, - 0.966896769, - 0.951602071, - 0.934263814, - 0.91490153, - 0.893087565, - 0.868295797, - 0.839980214, - 0.807522888, - 0.770669708, - 0.729325714, - 0.683190002, - 0.631342366, - 0.572309723, - 0.503807678, - 0.424613749, - 0.34130806, - 0.251240946, - 0.145490374, - 0, - 0, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000870134, - 1, - 1.000412251, - 1.000371386, - 1.000536977, - 1.000474123, - 1.000149609, - 0.999925334, - 0.997950745, - 0.992567851, - 0.983164063, - 0.969894918, - 0.955087891, - 0.938956604, - 0.92146698, - 0.900858866, - 0.876678263, - 0.849934998, - 0.818909353, - 0.78348053, - 0.742989451, - 0.696685028, - 0.64331131, - 0.580691935, - 0.509305827, - 0.431949565, - 0.348958842, - 0.256609065, - 0.147383639, - 0, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000660956, - 1, - 1.000241622, - 1.000227525, - 1.000355543, - 1.000367177, - 1.000177316, - 1.000088847, - 0.999998322, - 0.998716489, - 0.993788889, - 0.984393858, - 0.972777127, - 0.960075558, - 0.94547464, - 0.928713592, - 0.909181324, - 0.887171689, - 0.861867913, - 0.832409779, - 0.797523504, - 0.757344436, - 0.710841863, - 0.656110741, - 0.593423712, - 0.522404885, - 0.445499657, - 0.359952898, - 0.262699446, - 0.140437139, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000430327, - 1, - 1.000085802, - 1.000083161, - 1.000136051, - 1.000151812, - 1.000084472, - 1.000059185, - 1.000124339, - 1.000143795, - 0.999140523, - 0.994668884, - 0.98718811, - 0.978343506, - 0.967970174, - 0.954970703, - 0.939435832, - 0.92151418, - 0.901042074, - 0.876890157, - 0.848287506, - 0.813690542, - 0.773740489, - 0.727496134, - 0.673696035, - 0.610398814, - 0.53985021, - 0.460823301, - 0.369907043, - 0.261237583, - 0.110538737, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000217275, - 1, - 1.00000277, - 1.00000274, - 1.00000462, - 1.0000054, - 1.000003227, - 1.000002554, - 1.000006922, - 1.000021604, - 1.000019209, - 0.999762066, - 0.997236826, - 0.99215781, - 0.985214537, - 0.976632629, - 0.966251998, - 0.953367201, - 0.93740136, - 0.917841809, - 0.894117416, - 0.865701622, - 0.83209896, - 0.792797394, - 0.747250891, - 0.693787412, - 0.631141856, - 0.558409942, - 0.474917611, - 0.377272279, - 0.256452988, - 0.050848489, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000060823, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000033179, - 0.999215596, - 0.996047872, - 0.991702983, - 0.986147868, - 0.978149109, - 0.967190552, - 0.952952576, - 0.934723714, - 0.912378031, - 0.885308228, - 0.852728526, - 0.814278564, - 0.770332743, - 0.716678162, - 0.652663829, - 0.578919932, - 0.492081858, - 0.388540567, - 0.252610601, - 0, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0.998391724, - 0.995362549, - 0.990088603, - 0.981777242, - 0.969780375, - 0.953738403, - 0.933355306, - 0.907830099, - 0.876827698, - 0.839707743, - 0.795846507, - 0.743832143, - 0.682505239, - 0.609659933, - 0.520594126, - 0.407894109, - 0.251062353, - 0 - ] -] -)} - -function _22(md){return( -md `The following table and chart represents the final offset table with the normalized [half-breadths](https://www.sciencedirect.com/topics/engineering/shipyard) measurements. - -That table has station columns across the top and and water line row entries in the first column:` -)} - -function _offsetTable(waterlines,stations,halfBreadthTable) -{ - - - const wl = waterlines; - const st = stations.map(s => s.toString()); - - return halfBreadthTable.map((r,i) => { const row = {}; - row["water line"] = wl[i]; - r.forEach((hb,j) => - row[st[j]] = hb === null ? "null":hb); - return row; - }) - .sort((a,b)=>a["water line"] s.toString()); - const columns = ["water line"].concat(st.sort((a,b) => a st.forEach((s,j) => {if (hb[i][j]) data.push({waterLine: w, station:s, hb: hb[i][j]}) } )) - - - const points = vl.markPoint({shape:"cross", size:2, color:"navy"}) - .width(width) - .encode(vl.x().fieldQ("station").sort("descending"), - vl.y().fieldQ("waterLine"), - vl.tooltip([vl.tooltip().fieldQ("waterLine").title("Water Line"), - vl.tooltip().fieldQ("station").title("Station"), - vl.tooltip().fieldQ("hb").title("Half-breadth") - ]), - ); - - - return points.data(data).render(); - -} - - -function _27(md){return( -md`### Instantiating a Vessel Ship Instance - -The JSON object is passed to the *Ship* method of the *Vessel* object (found in [vessel.js](https://github.com/shiplab/vesseljs)) to instantiate a new *ship* object. This object will be a requirement for accessing other modules in [vessel.js](https://github.com/shiplab/vesseljs). -` -)} - -function _ship(Vessel,Gunnerus){return( -new Vessel.Ship(Gunnerus) -)} - -function _29(md){return( -md `### Instantiating a Vessel Ship3d - -Once a ship object has been instantiated, the *Ship3D* method can be invoked to instantiate a *Ship3D* visualization object: -` -)} - -function _ship3D(Ship3D,ship){return( -new Ship3D(ship) -)} - -function _31(md,Gunnerus){return( -md` -The visualisation of the ship is created using a [snippet](#Snippets) to transform the ship object into a 3D visualiztion using the [THREE.js](https://threejs.org/) library. - -The red color express the region bellow the water line according to (Gunnerus.designState.calculationParameters.Draft_design) that has a value of ***${Gunnerus.designState.calculationParameters.Draft_design} m***. -` -)} - -function* _32(THREE,width,ship,invalidation,ship3D) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(LOA / 2, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _33(md){return( -md ` - [<< Introduction](../index) || Top || [Next >>](../chapter-2/index.html) -` -)} - -function _34(md){return( -md`### References` -)} - -function _35(md){return( -md ` -**[1] Structure Definition ** – -Icaro Fonseca [/@icarofonseca/hull-definition-and-hydrostatics](https://observablehq.com/@icarofonseca/hull-definition-and-hydrostatics) -` -)} - -function _Snippets(md){return( -md`### Snippets` -)} - -function _Ship3D(THREE,Vessel) -{//@EliasHasle - -/* -THREE.js Object3D constructed from Vessel.js Ship object. - -There are some serious limitations to this: -1. null values encountered are assumed to be either at the top or bottom of the given station. -2. The end caps and bulkheads are sometimes corrected with zeros where they should perhaps have been clipped because of null values. -*/ - -//var hMat; //global for debugging - -function Ship3D(ship, stlPath) { - THREE.Group.call(this); - - this.ship = ship; - - let hull = ship.structure.hull; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //console.log("LOA:%.1f, BOA:%.1f, Depth:%.1f",LOA,BOA,Depth); - - this.position.z = -ship.designState.calculationParameters.Draft_design; - - //Hull - let stations = hull.halfBreadths.stations; - let waterlines = hull.halfBreadths.waterlines; - let table = hull.halfBreadths.table; - //None of these are changed during correction of the geometry. - - console.log(stations); - console.log(waterlines); - console.log(table); - - let N = stations.length; - let M = waterlines.length; - //Hull side, in principle Y offsets on an XZ plane: - //Even though a plane geometry is usually defined in terms of Z offsets on an XY plane, the order of the coordinates for each vertex is not so important. What is important is to get the topology right. This is ensured by working with the right order of the vertices. - let hGeom = new THREE.PlaneBufferGeometry(undefined, undefined, N - 1, M - 1); - let pos = hGeom.getAttribute("position"); - let pa = pos.array; - - //loop1: - //zs - let c = 0; - //Iterate over waterlines - for (let j = 0; j < M; j++) { - //loop2: - //xs - //iterate over stations - for (let i = 0; i < N; i++) { - //if (table[j][i] === null) continue;// loop1; - pa[c] = stations[i]; //x - //DEBUG, OK. No attempts to read outside of table - /*if(typeof table[j] === "undefined") console.error("table[%d] is undefined", j); - else if (typeof table[j][i] === "undefined") console.error("table[%d][%d] is undefined", j, i);*/ - //y - pa[c + 1] = table[j][i]; //y - pa[c + 2] = waterlines[j]; //z - c += 3; - } - } - //console.error("c-pa.length = %d", c-pa.length); //OK, sets all cells - - //Get rid of nulls by merging their points with the closest non-null point in the same station: - /*I am joining some uvs too. Then an applied texture will be cropped, not distorted, where the hull is cropped.*/ - let uv = hGeom.getAttribute("uv"); - let uva = uv.array; - //Iterate over stations - for (let i = 0; i < N; i++) { - let firstNumberJ; - let lastNumberJ; - //Iterate over waterlines - let j; - for (j = 0; j < M; j++) { - let y = table[j][i]; - //If this condition is satisfied (number found), - //the loop will be quitted - //after the extra logic below: - if (y !== null) { - firstNumberJ = j; - lastNumberJ = j; - //copy vector for i,j to positions for all null cells below: - let c = firstNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (firstNumberJ > 0) { - firstNumberJ--; - d -= N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - break; - } - console.log("null encountered."); - } - - //Continue up the hull (with same j counter), searching for upper number. This does not account for the existence of numbers above the first null encountered. - for (; j < M; j++) { - let y = table[j][i]; - if (y === null) { - console.log("null encountered."); - break; - } - //else not null: - lastNumberJ = j; - } - - //copy vector for i,j to positions for all null cells above: - let c = lastNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (lastNumberJ < M - 1) { - lastNumberJ++; - d += N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - ////////// - } - - //console.log(pa); - - pos.needsUpdate = true; - uv.needsUpdate = true; - hGeom.computeVertexNormals(); - - //Bow cap: - let bowPlaneOffsets = hull.getStation(LOA).map(str => str / (0.5 * BOA)); //normalized - let bowCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = bowCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 1; - pa[3 * (2 * j) + 1] = bowPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 1; - pa[3 * (2 * j + 1) + 1] = -bowPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Aft cap: - let aftPlaneOffsets = hull.getStation(0).map(str => str / (0.5 * BOA)); //normalized - let aftCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = aftCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 0; - pa[3 * (2 * j) + 1] = -aftPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 0; - pa[3 * (2 * j + 1) + 1] = aftPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Bottom cap: - let bottomPlaneOffsets = hull.getWaterline(0).map(hw => hw / (0.5 * BOA)); //normalized - let bottomCapG = new THREE.PlaneBufferGeometry(undefined, undefined, N - 1, 1); - pos = bottomCapG.getAttribute("position"); - pa = pos.array; - //constant z-offset xy plane - for (let i = 0; i < N; i++) { - pa[3 * (i)] = stations[i]; - pa[3 * (i) + 1] = -bottomPlaneOffsets[i]; - pa[3 * (i) + 2] = 0; - pa[3 * (N + i)] = stations[i]; - pa[3 * (N + i) + 1] = bottomPlaneOffsets[i]; - pa[3 * (N + i) + 2] = 0; - } - pos.needsUpdate = true; - - //Hull material - let phong = THREE.ShaderLib.phong; - let commonDecl = "uniform float wlThreshold;uniform vec3 aboveWL; uniform vec3 belowWL;\nvarying vec3 vPos;"; - let hMat = new THREE.ShaderMaterial({ - uniforms: THREE.UniformsUtils.merge([phong.uniforms, { - wlThreshold: new THREE.Uniform(ship.designState.calculationParameters.Draft_design / Depth), - aboveWL: new THREE.Uniform(new THREE.Color(0x33aa33)), - belowWL: new THREE.Uniform(new THREE.Color(0xaa3333)) - }]), - vertexShader: commonDecl + phong.vertexShader.replace("main() {", "main() {\nvPos = position.xyz;").replace("#define PHONG", ""), - fragmentShader: commonDecl + phong.fragmentShader.replace("vec4 diffuseColor = vec4( diffuse, opacity );", - "vec4 diffuseColor = vec4( (vPos.z>wlThreshold)? aboveWL.rgb : belowWL.rgb, opacity );").replace("#define PHONG", ""), - side: THREE.DoubleSide, - lights: true, - transparent: true - }); - hMat.uniforms.opacity.value = 0.5; - - let hullGroup = new THREE.Group(); - let port = new THREE.Mesh(hGeom, hMat); - let starboard = new THREE.Mesh(hGeom, hMat); - starboard.scale.y = -1; - hullGroup.add(port, starboard); - - //Caps: - hullGroup.add(new THREE.Mesh(bowCapG, hMat)); - hullGroup.add(new THREE.Mesh(aftCapG, hMat)); - hullGroup.add(new THREE.Mesh(bottomCapG, hMat)); - - hullGroup.scale.set(LOA, 0.5 * BOA, Depth); - this.hullGroup = hullGroup; - this.add(hullGroup); - - //DEBUG, to show only hull: - //return; - - //Decks: - var decks = new THREE.Group(); - let deckMat = new THREE.MeshPhongMaterial({color: 0xcccccc/*this.randomColor()*/, transparent: true, opacity: 0.2, side: THREE.DoubleSide}); - //deckGeom.translate(0,0,-0.5); - let ds = ship.structure.decks; - let dk = Object.keys(ds); - let stss = stations.map(st => LOA * st); //use scaled stations for now - console.log(dk); - for (let i = 0; i < dk.length; i++) { - let d = ds[dk[i]]; //deck in ship structure - - //Will eventually use BoxBufferGeometry, but that is harder, because vertices are duplicated in the face planes. - let deckGeom = new THREE.PlaneBufferGeometry(1, 1, stss.length, 1);//new THREE.BoxBufferGeometry(1,1,1,sts.length,1,1); - console.log("d.zFloor=%.1f", d.zFloor); //DEBUG - let zHigh = d.zFloor; - let zLow = d.zFloor - d.thickness; - let wlHigh = hull.getWaterline(zHigh); - let wlLow = hull.getWaterline(zLow); - let pos = deckGeom.getAttribute("position"); - let pa = pos.array; - for (let j = 0; j < stss.length + 1; j++) { - let x = d.xAft + (j / stss.length) * (d.xFwd - d.xAft); - let y1 = Vessel.f.linearFromArrays(stss, wlHigh, x); - let y2 = Vessel.f.linearFromArrays(stss, wlLow, x); - let y = Math.min(0.5 * d.breadth, y1, y2); - pa[3 * j] = x; - pa[3 * j + 1] = y; - pa[3 * (stss.length + 1) + 3 * j] = x; - pa[3 * (stss.length + 1) + 3 * j + 1] = -y; //test - } - pos.needsUpdate = true; - - //DEBUG - console.log("d.xFwd=%.1f, d.xAft=%.1f, 0.5*d.breadth=%.1f", d.xFwd, d.xAft, 0.5 * d.breadth); - console.log(pa); - - let deck = new THREE.Mesh(deckGeom, deckMat); - deck.name = dk[i]; - deck.position.z = d.zFloor; - //deck.scale.set(d.xFwd-d.xAft, d.breadth, d.thickness); - //deck.position.set(0.5*(d.xFwd+d.xAft), 0, d.zFloor); - decks.add(deck); - } - this.decks = decks; - this.add(decks); - - //Bulkheads: - var bulkheads = new THREE.Group(); - bulkheads.scale.set(1, 0.5 * BOA, Depth); - let bhGeom = new THREE.BoxBufferGeometry(1, 1, 1); - bhGeom.translate(0, 0, 0.5); - let bhMat = new THREE.MeshPhongMaterial({color: 0xcccccc/*this.randomColor()*/, transparent: true, opacity: 0.5, side: THREE.DoubleSide}); - bhGeom.translate(0.5, 0, 0); - let bhs = ship.structure.bulkheads; - let bhk = Object.keys(bhs); - for (let i = 0; i < bhk.length; i++) { - let bulkhead = new THREE.Mesh(bhGeom, bhMat); - let bh = bhs[bhk[i]]; - bulkhead.name = bhk[i]; - bulkhead.scale.set(bh.thickness, 1, 1); - bulkhead.position.set(bh.xAft, 0, 0); - bulkheads.add(bulkhead); - } - this.bulkheads = bulkheads; - this.add(bulkheads); - - //Objects - - this.materials = {}; - this.stlPath = stlPath; - let stlManager = new THREE.LoadingManager(); - this.stlLoader = new THREE.STLLoader(stlManager); - /*stlManager.onLoad = function() { - createGUI(materials, deckMat); - }*/ - - this.blocks = new THREE.Group(); - this.add(this.blocks); - - //Default placeholder geometry - this.boxGeom = new THREE.BoxBufferGeometry(1, 1, 1); - this.boxGeom.translate(0, 0, 0.5); - - let objects = Object.values(ship.derivedObjects); - for (let i = 0; i < objects.length; i++) { - this.addObject(objects[i]); - } - - //console.log("Reached end of Ship3D constructor."); -} -Ship3D.prototype = Object.create(THREE.Group.prototype); -Object.assign(Ship3D.prototype, { - constructor: Ship3D, - addObject: function(object) { - let mat; - let name = this.stripName(object.id); - if (this.materials[name] !== undefined) { - mat = this.materials[name]; - } else { - mat = new THREE.MeshPhongMaterial({color: this.randomColor(), transparent: true, opacity: 0.5}); - this.materials[name] = mat; - } - - let bo = object.baseObject; - - //Position - let s = this.ship.designState.getObjectState(object); - let x = s.xCentre; - let y = s.yCentre; - let z = s.zBase; - - //Scale - let d = bo.boxDimensions; - - if (bo.file3D) { - let self = this; - this.stlLoader.load( - this.stlPath + "/" + bo.file3D, - function onLoad(geometry) { - //Normalize: - geometry.computeBoundingBox(); - let b = geometry.boundingBox; - geometry.translate(-b.min.x, -b.min.y, -b.min.z); - geometry.scale(1 / (b.max.x - b.min.x), - 1 / (b.max.y - b.min.y), - 1 / (b.max.z - b.min.z)); - //Align with the same coordinate system as placeholder blocks: - geometry.translate(-0.5, -0.5, 0); - let m = new THREE.Mesh(geometry, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - self.blocks.add(m); - }, - undefined, - function onError() { - //console.warn("Specified file " + e.File + " not found. Falling back on placeholder."); - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - ); - } else { - //Placeholder: - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - }, - //this function is used as a temporary hack to group similar objects by color - stripName: function(s) { - s = s.replace(/[0-9]/g, ""); - s = s.trim(); - return s; - }, - randomColor: function() { - let r = Math.round(Math.random() * 0xff); - let g = Math.round(Math.random() * 0xff); - let b = Math.round(Math.random() * 0xff); - return ((r << 16) | (g << 8) | b); - } -}); - - return Ship3D; -} - - -function _38(md){return( -md`### Libraries` -)} - -function _Vessel(require){return( -require('ntnu-vessel@0.1.1/vessel.js').catch(() => window["Vessel"]) -)} - -async function _THREE(require) -{ - const THREE = window.THREE = await require("three@0.99.0/build/three.min.js"); - await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {}); - await require("three@0.99.0/examples/js/loaders/STLLoader.js").catch(() => {}); - return THREE; -} - - -function _d3(require){return( -require("d3@5") -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["md"], _2); - main.variable(observer()).define(["md"], _3); - main.variable(observer()).define(["md"], _4); - main.variable(observer()).define(["md"], _5); - main.variable(observer()).define(["md"], _6); - main.variable(observer()).define(["md"], _7); - main.variable(observer("Gunnerus")).define("Gunnerus", _Gunnerus); - main.variable(observer()).define(["md"], _9); - main.variable(observer()).define(["Gunnerus"], _10); - main.variable(observer()).define(["md"], _11); - main.variable(observer()).define(["Gunnerus"], _12); - main.variable(observer()).define(["md","waterlines"], _13); - main.variable(observer()).define(["Gunnerus","waterlines"], _14); - main.variable(observer("waterlines")).define("waterlines", _waterlines); - main.variable(observer()).define(["md","stations"], _16); - main.variable(observer()).define(["Gunnerus","stations"], _17); - main.variable(observer("stations")).define("stations", _stations); - main.variable(observer()).define(["md"], _19); - main.variable(observer()).define(["Gunnerus","halfBreadthTable"], _20); - main.variable(observer("halfBreadthTable")).define("halfBreadthTable", _halfBreadthTable); - main.variable(observer()).define(["md"], _22); - main.variable(observer("offsetTable")).define("offsetTable", ["waterlines","stations","halfBreadthTable"], _offsetTable); - main.variable(observer()).define(["table","offsetTable"], _24); - main.variable(observer()).define(["md"], _25); - main.variable(observer()).define(["waterlines","stations","halfBreadthTable","vl","width"], _26); - main.variable(observer()).define(["md"], _27); - main.variable(observer("ship")).define("ship", ["Vessel","Gunnerus"], _ship); - main.variable(observer()).define(["md"], _29); - main.variable(observer("ship3D")).define("ship3D", ["Ship3D","ship"], _ship3D); - main.variable(observer()).define(["md","Gunnerus"], _31); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D"], _32); - main.variable(observer()).define(["md"], _33); - main.variable(observer()).define(["md"], _34); - main.variable(observer()).define(["md"], _35); - main.variable(observer("Snippets")).define("Snippets", ["md"], _Snippets); - main.variable(observer("Ship3D")).define("Ship3D", ["THREE","Vessel"], _Ship3D); - main.variable(observer()).define(["md"], _38); - main.variable(observer("Vessel")).define("Vessel", ["require"], _Vessel); - main.variable(observer("THREE")).define("THREE", ["require"], _THREE); - main.variable(observer("d3")).define("d3", ["require"], _d3); - const child1 = runtime.module(define1); - main.import("table", child1); - const child2 = runtime.module(define2); - main.import("vl", child2); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/715b4c45cc45c3b3@223.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/715b4c45cc45c3b3@223.js deleted file mode 100644 index 0aa8b76..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/715b4c45cc45c3b3@223.js +++ /dev/null @@ -1,423 +0,0 @@ -// https://observablehq.com/@gampleman/table@223 -function _1(md){return( -md`# Table - -This is an extension of [Fancy Tables](https://beta.observablehq.com/@tmcw/fancy-tables) by @tmcw. - -The main advantage here is that: - -1. This can be used without creating a cell. Simply by passing in data and then creating a variable with \`viewof\` one can get both a nice view of the data and the data as a variable. -2. Because of this, if the data is a promise (i.e. a fetch), a loading animation will be rendered. Support for streaming data may come in the future. -3. The data can be sorted by clicking the table headers. -4. The styling is designed for overflow scrolling. - -## Usage - -First import this into your notebook: - -~~~javascript -import { table } from "@gampleman/table" -~~~ - -The simplest usage is to simply pass in an array of objects: -` -)} - -function _2(table){return( -table([ - {first_name: 'John', last_name: 'Doe'}, - {first_name: 'Martin', last_name: 'Smith'} -]) -)} - -function _3(md){return( -md`You can also pass in something that produces a promise:` -)} - -function _4(table,json_url){return( -table( - fetch(json_url).then(d => d.json()) -) -)} - -function _5(md){return( -md`If you use \`viewof\`, you can also assign the data produced by the first argument in the same cell:` -)} - -function _data(table,json_url){return( -table( - fetch(json_url).then(d => d.json()) -) -)} - -function _7(data){return( -data -)} - -function _8(md){return( -md`Finally, you can use the second argument to customize the output:` -)} - -function _9(table,json_url){return( -table( - fetch(json_url).then(d => d.json()), - { - nully: () => 'No data', - limit: 500, - enableFilter: false, - enableCSVDownload: true, - columns: [{ - key: 'key', - name: 'Station ID', - render: val => `${val}` - }, - 'last1hrf', - 'rainfall', - 'rainfallmsg', - { - key: 'rfstationstatus', - name: 'RF Status' - }] - } -) -)} - -function _table(loader,defaultHumanize,html,parseQuery,DOM,CSV){return( -async function*(dataPromise, options = {}) { - yield loader; - - const dataO = await Promise.resolve(dataPromise); - - let filter = () => true; - - const data = Array.isArray(dataO) - ? dataO - : Object.entries(dataO).map(([key, v]) => Object.assign({ key }, v)); - - let { - humanize, - nully, - limit, - columns, - enableFilter, - enableCSVDownload, - maxHeight - } = Object.assign( - { - humanize: defaultHumanize, - nully: () => '-', - limit: 250, - columns: Object.keys(data[0]), - enableFilter: data.length > 50, - enableCSVDownload: true, - maxHeight: 400 - }, - options || {} - ); - - if (typeof maxHeight === 'number') maxHeight = `${maxHeight}px`; - - columns = columns.map(column => { - let key; - if (typeof column == 'string') { - key = column; - column = { key }; - } else { - key = column.key; - } - - const decimalNumber = data.reduce((memo, d) => { - if (typeof d[key] === 'number') { - let frac = (d[key] || '').toString().split('.')[1]; - if (frac) return Math.max(memo, frac.length); - } - return memo; - }, 0); - - return Object.assign( - { - name: humanize(key), - type: typeof data[0][key], - accessor: row => row[key], - render: val => { - if (decimalNumber && typeof val === 'number') { - return val.toFixed(decimalNumber); - } - if (val == null || val == undefined) { - return nully(val); - } - return val; - } - }, - column - ); - }); - const renderTable = () => { - return `${data - .filter(filter) - .slice(0, limit) - .map( - datum => - ` - ${columns - .map(c => { - return `${c.render(c.accessor(datum))}`; - }) - .join('')} - ` - ) - .join('')}`; - }; - const output = html` - - - - - - - - ${columns - .map( - c => `${c.name}` - ) - .join('')} - - - - ${renderTable()} - - ${ - data.filter(filter).length > limit - ? `This table has been truncated from ${data.length} rows to ${limit}` - : '' - } - -${ - enableFilter - ? '🔎' - : '' -} - - - `; - output.value = dataO; - yield output; - - output.querySelectorAll('th').forEach(th => - th.addEventListener('click', () => { - const key = th.dataset.key; - const order = th.dataset.order === 'ascending' ? -1 : 1; - data.sort((a, b) => - a[key] > b[key] ? order : b[key] > a[key] ? -order : 0 - ); - output.querySelector('tbody').innerHTML = renderTable(); - th.dataset.order = order === -1 ? 'descending' : 'ascending'; - }) - ); - if (enableFilter) { - const search = output.querySelector('input[type=search]'); - search.addEventListener('input', e => { - filter = parseQuery(search.value, columns); - output.querySelector('tbody').innerHTML = renderTable(); - }); - } - if (enableCSVDownload) { - output.appendChild( - DOM.download( - new Blob( - [ - CSV(data, { - fields: columns.map(c => ({ label: c.name, value: c.key })) - }) - ], - { type: "application/json" } - ), - 'data.csv', - '⬇' - ) - ); - } -} -)} - -function _parseQuery(){return( -(q, headers) => { - if (q == '') { - return () => true; - } else if (q.match(/[=<>]/)) { - try { - const code = headers.reduce((q, {key, name}) => q.replace(new RegExp(`\\b(${key}|${name})\\b`, 'g'), `data['${key}']`), q).replace(/([^=<>!])=([^=<>!]|$)/g, '$1===$2'); - return new Function('data', `try { return ${code} } catch(e) { return false; }` ); - } catch (e) { - return () => true; - } - } else { - const re = new RegExp(q, 'i'); - return data => headers.some(({key}) => (data[key] || '').toString().match(re)) - } -} -)} - -function _loader(html){return( -html` - Loading...` -)} - -function _defaultHumanize(){return( -str => str.replace(/[-_]/g, ' ') -)} - -function _json_url(){return( -'https://gist.githubusercontent.com/gampleman/0903af7279c6c60e6d5c85ca33361960/raw/b21a86ceb808307208970b24045cfe9bc9a6f744/rainlevels.json' -)} - -function _CSV(require){return( -require('json2csv@4.0.0').then(a => a.parse) -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["table"], _2); - main.variable(observer()).define(["md"], _3); - main.variable(observer()).define(["table","json_url"], _4); - main.variable(observer()).define(["md"], _5); - main.variable(observer("viewof data")).define("viewof data", ["table","json_url"], _data); - main.variable(observer("data")).define("data", ["Generators", "viewof data"], (G, _) => G.input(_)); - main.variable(observer()).define(["data"], _7); - main.variable(observer()).define(["md"], _8); - main.variable(observer()).define(["table","json_url"], _9); - main.variable(observer("table")).define("table", ["loader","defaultHumanize","html","parseQuery","DOM","CSV"], _table); - main.variable(observer("parseQuery")).define("parseQuery", _parseQuery); - main.variable(observer("loader")).define("loader", ["html"], _loader); - main.variable(observer("defaultHumanize")).define("defaultHumanize", _defaultHumanize); - main.variable(observer("json_url")).define("json_url", _json_url); - main.variable(observer("CSV")).define("CSV", ["require"], _CSV); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/7764a40fe6b83ca1@437.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/7764a40fe6b83ca1@437.js deleted file mode 100644 index be42612..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/7764a40fe6b83ca1@437.js +++ /dev/null @@ -1,295 +0,0 @@ -function _1(md){return( -md`# Vega-Lite API v4` -)} - -function _2(md){return( -md`The [Vega-Lite JavaScript API](https://github.com/vega/vega-lite-api/) provides a convenient way to write [Vega-Lite](https://vega.github.io/vega-lite) specifications in a programmatic fashion. Scroll down for some usage examples, or browse the [Vega-Lite API example collection](https://observablehq.com/collection/@vega/vega-lite-api)! - -This notebook uses **version 4** of Vega-Lite and the corresponding Vega-Lite API 4.0. _To use the more recent Vega-Lite version 5, see the [Vega-Lite API v5 notebook](https://observablehq.com/@vega/vega-lite-api-v5) instead._ - -Want to learn more about data visualization and how to use the Vega-Lite API? Read the [introduction to Vega-Lite](https://observablehq.com/@uwdata/introduction-to-vega-lite) and the [data visualization curriculum](https://observablehq.com/@uwdata/data-visualization-curriculum?collection=@uwdata/visualization-curriculum).` -)} - -function _3(md){return( -md` -The cell below imports the Vega-Lite API and registers the desired versions of Vega and Vega-Lite, along with default [Vega View options](https://vega.github.io/vega/docs/api/view/#view) and [Vega-Lite configuration](https://vega.github.io/vega-lite/docs/config.html): -` -)} - -async function _vl(require) -{ - const [vega, vegalite, api, tooltip] = await Promise.all([ - 'vega@5.23.0', - 'vega-lite@4.17.0', - 'vega-lite-api@4.0.0', - 'vega-tooltip@0.25.1' - ].map(module => require(module))); - - const options = { - config: { - // vega-lite default configuration - config: { - view: {continuousWidth: 400, continuousHeight: 300}, - mark: {tooltip: null} - } - }, - init: view => { - // initialize tooltip handler - view.tooltip(new tooltip.Handler().call); - // enable horizontal scrolling for large plots - if (view.container()) view.container().style['overflow-x'] = 'auto'; - }, - view: { - // view constructor options - loader: vega.loader({baseURL: 'https://cdn.jsdelivr.net/npm/vega-datasets@2/'}), - renderer: 'canvas' - } - }; - - return api.register(vega, vegalite, options); -} - - -function _5(md){return( -md`To use the same setup in your own notebooks, add a cell with the following code: -~~~ js -import {vl} from '@vega/vega-lite-api' -~~~ -To use the API outside of Observable, see the [stand-alone usage instructions](#standalone_use) below. -` -)} - -function _zip_codes(md){return( -md`## Zip Codes - -A dot for each zip code in the United States, colored by the first digit. -` -)} - -function _7(vl,width){return( -vl.markSquare({size: 2, opacity: 1}) - .data('data/zipcodes.csv') - .transform(vl.calculate('substring(datum.zip_code, 0, 1)').as('digit')) - .project( - vl.projection('albersUsa') - ) - .encode( - vl.longitude().fieldQ('longitude'), - vl.latitude().fieldQ('latitude'), - vl.color().fieldN('digit') - ) - .width(width) - .height(Math.floor(width / 1.75)) - .autosize({type: 'fit-x', contains: 'padding'}) - .config({view: {stroke: null}}) - .render() -)} - -function _interactive_weather(md){return( -md`## Interactive Seattle Weather 2012-2015 - -A scatter plot and summary histogram with linked \`selections\` between plots to perform cross-filtering and configure conditional color encodings. -` -)} - -function _9(vl,width) -{ - const brush = vl.selectInterval().encodings('x'); - const click = vl.selectMulti().encodings('color'); - - const scale = { - domain: ['sun', 'fog', 'drizzle', 'rain', 'snow'], - range: ['#e7ba52', '#a7a7a7', '#aec7e8', '#1f77b4', '#9467bd'] - }; - - const plot1 = vl.markPoint({filled: true}) - .encode( - vl.color().value('lightgray') - .if(brush, vl.color().fieldN('weather').scale(scale).title('Weather')), - vl.size().fieldQ('precipitation').scale({domain: [-1, 50], range: [10, 500]}).title('Precipitation'), - vl.order().fieldQ('precipitation').sort('descending'), - vl.x().timeMD('date').axis({title: 'Date', format: '%b'}), - vl.y().fieldQ('temp_max').scale({domain: [-5, 40]}).axis({title: 'Maximum Daily Temperature (°C)'}) - ) - .width(width) - .height(300) - .select(brush) - .transform(vl.filter(click)); - - const plot2 = vl.markBar() - .encode( - vl.color().value('lightgray') - .if(click, vl.color().fieldN('weather').scale(scale).title('Weather')), - vl.x().count(), - vl.y().fieldN('weather').scale({domain: scale.domain}).title('Weather') - ) - .width(width) - .select(click) - .transform(vl.filter(brush)); - - return vl.vconcat(plot1, plot2) - .data('data/seattle-weather.csv') - .autosize({type: 'fit-x', contains: 'padding'}) - .render(); -} - - -function _parallel_coordinats(md){return( -md`## Parallel Coordinates - -A [parallel coordinates plot](https://en.wikipedia.org/wiki/Parallel_coordinates) that uses \`window\` and \`fold\` transforms to convert the four dimensions of penguin measurements into normalized coordinates that can be visualized as \`line\` marks. The graphic includes an additional layer with custom \`text\` mark labels for the parallel axis grid lines. We render the plot as SVG by passing \`{renderer:'svg'}\` to the \`render\` method. -` -)} - -function _11(vl,width) -{ - const domain = [ - 'Beak Length (mm)', - 'Beak Depth (mm)', - 'Flipper Length (mm)', - 'Body Mass (g)' - ]; - - const scale = { - type: 'point', - padding: 0 - }; - - const axis = { - domain: false, - ticks: false, - title: false, - grid: true, - gridColor: '#888', - labelAngle: 0, - labelPadding: 8, - labelFontWeight: 'bold' - }; - - const lines = vl.markLine({ - strokeWidth: 1.5, - opacity: 0.5 - }) - .encode( - vl.color().fieldN('Species').sort('descending'), - vl.detail().fieldN('index'), - vl.x().fieldO('key').scale(scale).axis(axis), - vl.y().fieldQ('fraction').axis(null) - ); - - const labels = vl.markText({ - dx: -2, - align: 'right', - baseline: 'middle' - }) - .transform( - vl.groupby('key').aggregate(vl.min('value').as('min'), vl.max('value').as('max')), - vl.fold('min', 'max').as('op', 'value'), - vl.groupby('key').window(vl.percent_rank('value').as('fraction')) - ) - .encode( - vl.x().fieldN('key'), - vl.y().fieldQ('fraction').axis(null), - vl.text().field('value').format(',') - ); - - const plot = vl.layer(lines, labels) - .data('data/penguins.json') - .transform( - vl.filter('datum["Beak Length (mm)"] != null'), - vl.window(vl.row_number().as('index')), - vl.fold(domain).as('key', 'value'), - vl.groupby('key').join(vl.min('value').as('min'), vl.max('value').as('max')), - vl.calculate('(datum.value - datum.min) / (datum.max - datum.min)').as('fraction') - ) - .width(width) - .height(300) - .autosize({type: 'fit-x', contains: 'padding'}) - - return plot.render({renderer: 'svg'}); -} - - -function _standalone_use(md){return( -md` -## Stand-Alone Usage in a Web Browser - -To use the Vega-Lite API in the browser outside of Observable, you need to include all the dependencies, set the default configuration, and then register the Vega libraries. Here is some starting code to build from: - -~~~html - - - - - - - - - - - - - - - - -~~~` -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["md"], _2); - main.variable(observer()).define(["md"], _3); - main.variable(observer("vl")).define("vl", ["require"], _vl); - main.variable(observer()).define(["md"], _5); - main.variable(observer("zip_codes")).define("zip_codes", ["md"], _zip_codes); - main.variable(observer()).define(["vl","width"], _7); - main.variable(observer("interactive_weather")).define("interactive_weather", ["md"], _interactive_weather); - main.variable(observer()).define(["vl","width"], _9); - main.variable(observer("parallel_coordinats")).define("parallel_coordinats", ["md"], _parallel_coordinats); - main.variable(observer()).define(["vl","width"], _11); - main.variable(observer("standalone_use")).define("standalone_use", ["md"], _standalone_use); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/README.md b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/README.md deleted file mode 100644 index 9de11a8..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Chapter 1 - From Plane Lines to 3D Hull - -https://observablehq.com/@ferrari212/chapter-1@392 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/6d6823c516e88279@392.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/chapter-1"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/index.html b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/index.html deleted file mode 100644 index 0806b1b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Chapter 1 - From Plane Lines to 3D Hull - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/index.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/index.js deleted file mode 100644 index e72bfdb..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./6d6823c516e88279@392.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/package.json b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/package.json deleted file mode 100644 index 2d6079f..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/chapter-1", - "main": "6d6823c516e88279@392.js", - "version": "392.0.0", - "homepage": "https://observablehq.com/@ferrari212/chapter-1", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-1/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/README.md b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/README.md deleted file mode 100644 index 8e550cf..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Chapter 2 - From GA to Blocks - -https://observablehq.com/@ferrari212/chapter-2-from-ga-to-blocks@344 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/c53e95309e85a5e2@344.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/chapter-2-from-ga-to-blocks"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/c53e95309e85a5e2@344.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/c53e95309e85a5e2@344.js deleted file mode 100644 index 437a80c..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/c53e95309e85a5e2@344.js +++ /dev/null @@ -1,822 +0,0 @@ -// https://observablehq.com/@ferrari212/chapter-2-from-ga-to-blocks@344 -function _1(md){return( -md` -# Chapter 2 - From GA to Blocks -# Section 2.1 - Decks and Bulckheads -` -)} - -function _2(md){return( -md`The General Arrangement of the ship indicates the position of the items and tanks onboard. With the arrengement of the equipments it is possible to estimate the location of Ship's [Center of Gravity](https://en.wikipedia.org/wiki/Center_of_mass#Center_of_gravity). In this chapter we will introduce the equipments present in the general arrangement in the 3D model inside the ship developted on the [Chapter 1](https://observablehq.com/d/6383409a326255b7?collection=@ferrari212/from-hull-to-simulation). The code bellow shows the object containing the ship information presented so far as defined in the previous chapter. -` -)} - -function _Gunnerus(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "pink", - "lowerColor": "grey", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - "Deck_1": { - "zFloor": 3, - "thickness": 0.01, - "xAft": 0, - "xFwd": 20, - "yCentre": 0, - "breadth": 8, - "density": 7850 - } - }, - "bulkheads": { - } - }, - "baseObjects": [], - - "derivedObjects": [] - -} -)} - -function _4(md){return( -md ` - -The elements that are going to be inserted in this section will be: - -* Deck -* Bulkhead - -The information regarding those elements are presented in Gunnerus.structure.decks and Gunnerus.structure.bulkheads. The location of those elements are represented in the drawing profile bellow: - - -` -)} - -function _5(md){return( -md ` -The following table represents the decks informations: - -| Object | Function | unit | -|:----:|:-------------:|:-------------:| -| zfloor | Vertical distance from the base line | m | -| thickness | Plate thickness | m | -| xAft | Horizontal Beginning | m | -| xFwd | Horizontal End | m | -| yCentre | Transversal Distance from the Base Line | m | -| breadth | Total width | m | -| density | Material Density | kg/m3 | - -The following code inserts the information for the A-deck and 1-deck in the object: -` -)} - -function _6(Gunnerus){return( -Gunnerus.structure.decks.Deck_A = { - "zFloor": 6.686, - "thickness": 0.1, - "xAft": 15.500, - "xFwd": 35.600, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 -} -)} - -function _7(Gunnerus){return( -Gunnerus.structure.decks.Deck_1 = { - "zFloor": 4.286, - "thickness": 0.1, - "xAft": 0, - "xFwd": 33.680, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 -} -)} - -function _8(md){return( -md` -The similar process can be used for the bulkheads. The variables necessary in the object will be: - -| Object | Function | unit | -|:----:|:-------------:|:-------------:| -| xAft | Horizontal Beginning | m | -| thickness | Plate thickness | m | -| density | Material Density | kg/m3 | -` -)} - -function _9(Gunnerus){return( -Gunnerus.structure.bulkheads.AB = { - "xAft": 5, - "thickness": 0.1, - "density": 7850 -} -)} - -function _10(Gunnerus){return( -Gunnerus.structure.bulkheads.GB = { - "xAft": 17.95, - "thickness": 0.1, - "density": 7850 -} -)} - -function _11(Gunnerus){return( -Gunnerus.structure.bulkheads.B23 = { - "xAft": 22.00, - "thickness": 0.1, - "density": 7850 -} -)} - -function _12(Gunnerus){return( -Gunnerus.structure.bulkheads.FB = { - "xAft": 31.5, - "thickness": 0.1, - "density": 7850 -} -)} - -function _13(md){return( -md`Now it is possible to use the Ship function to generate the model as done in [Chapter 1](https://observablehq.com/d/6383409a326255b7?collection=@ferrari212/from-hull-to-simulation): -` -)} - -function _ship(Vessel,Gunnerus){return( -new Vessel.Ship(Gunnerus) -)} - -function _ship3D(Ship3D,ship){return( -new Ship3D(ship, 1, 1, 1) -)} - -function* _16(THREE,width,ship,invalidation,ship3D) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(LOA / 2, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _17(md){return( -md ` - [<< Previous](../chapter-2/index.html) || Top || [Next >>](../section-2-2/index.html) -` -)} - -function _18(md){return( -md`### References` -)} - -function _19(md){return( -md ` -**[1] Structure Definition ** – -Icaro Fonseca [/@icarofonseca/hull-definition-and-hydrostatics](https://observablehq.com/@icarofonseca/hull-definition-and-hydrostatics) -` -)} - -function _20(md){return( -md`### Snippets` -)} - -function _Ship3D(THREE,Vessel) -{ - //@EliasHasle - - /* -THREE.js Object3D constructed from Vessel.js Ship object. - -There are some serious limitations to this: -1. null values encountered are assumed to be either at the top or bottom of the given station. -2. The end caps and bulkheads are sometimes corrected with zeros where they should perhaps have been clipped because of null values. -*/ - - //var hMat; //global for debugging - - function Ship3D(ship, stlPath, deckOpacity = 0.2, objectOpacity = 0.5) { - THREE.Group.call(this); - - this.ship = ship; - - this.normalizer = new THREE.Group(); - this.fluctCont = new THREE.Group(); - this.fluctCont.rotation.order = "ZYX"; //right? - this.cmContainer = new THREE.Group(); - this.fluctCont.add(this.cmContainer); - this.normalizer.add(this.fluctCont); - this.add(this.normalizer); - let hull = ship.structure.hull; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //console.log("LOA:%.1f, BOA:%.1f, Depth:%.1f",LOA,BOA,Depth); - - this.position.z = -ship.designState.calculationParameters.Draft_design; - - //Hull - let stations = hull.halfBreadths.stations; - let waterlines = hull.halfBreadths.waterlines; - let table = hull.halfBreadths.table; - //None of these are changed during correction of the geometry. - - console.log(stations); - console.log(waterlines); - console.log(table); - - let N = stations.length; - let M = waterlines.length; - //Hull side, in principle Y offsets on an XZ plane: - //Even though a plane geometry is usually defined in terms of Z offsets on an XY plane, the order of the coordinates for each vertex is not so important. What is important is to get the topology right. This is ensured by working with the right order of the vertices. - let hGeom = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - M - 1 - ); - let pos = hGeom.getAttribute("position"); - let pa = pos.array; - - //loop1: - //zs - let c = 0; - //Iterate over waterlines - for (let j = 0; j < M; j++) { - //loop2: - //xs - //iterate over stations - for (let i = 0; i < N; i++) { - //if (table[j][i] === null) continue;// loop1; - pa[c] = stations[i]; //x - //DEBUG, OK. No attempts to read outside of table - /*if(typeof table[j] === "undefined") console.error("table[%d] is undefined", j); - else if (typeof table[j][i] === "undefined") console.error("table[%d][%d] is undefined", j, i);*/ - //y - pa[c + 1] = table[j][i]; //y - pa[c + 2] = waterlines[j]; //z - c += 3; - } - } - //console.error("c-pa.length = %d", c-pa.length); //OK, sets all cells - - //Get rid of nulls by merging their points with the closest non-null point in the same station: - /*I am joining some uvs too. Then an applied texture will be cropped, not distorted, where the hull is cropped.*/ - let uv = hGeom.getAttribute("uv"); - let uva = uv.array; - //Iterate over stations - for (let i = 0; i < N; i++) { - let firstNumberJ; - let lastNumberJ; - //Iterate over waterlines - let j; - for (j = 0; j < M; j++) { - let y = table[j][i]; - //If this condition is satisfied (number found), - //the loop will be quitted - //after the extra logic below: - if (y !== null) { - firstNumberJ = j; - lastNumberJ = j; - //copy vector for i,j to positions for all null cells below: - let c = firstNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (firstNumberJ > 0) { - firstNumberJ--; - d -= N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - break; - } - console.log("null encountered."); - } - - //Continue up the hull (with same j counter), searching for upper number. This does not account for the existence of numbers above the first null encountered. - for (; j < M; j++) { - let y = table[j][i]; - if (y === null) { - console.log("null encountered."); - break; - } - //else not null: - lastNumberJ = j; - } - - //copy vector for i,j to positions for all null cells above: - let c = lastNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (lastNumberJ < M - 1) { - lastNumberJ++; - d += N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - ////////// - } - - //console.log(pa); - - pos.needsUpdate = true; - uv.needsUpdate = true; - hGeom.computeVertexNormals(); - - //Bow cap: - let bowPlaneOffsets = hull.getStation(LOA).map(str => str / (0.5 * BOA)); //normalized - let bowCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = bowCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 1; - pa[3 * (2 * j) + 1] = bowPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 1; - pa[3 * (2 * j + 1) + 1] = -bowPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Aft cap: - let aftPlaneOffsets = hull.getStation(0).map(str => str / (0.5 * BOA)); //normalized - let aftCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = aftCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 0; - pa[3 * (2 * j) + 1] = -aftPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 0; - pa[3 * (2 * j + 1) + 1] = aftPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Bottom cap: - let bottomPlaneOffsets = hull.getWaterline(0).map(hw => hw / (0.5 * BOA)); //normalized - let bottomCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - 1 - ); - pos = bottomCapG.getAttribute("position"); - pa = pos.array; - //constant z-offset xy plane - for (let i = 0; i < N; i++) { - pa[3 * i] = stations[i]; - pa[3 * i + 1] = -bottomPlaneOffsets[i]; - pa[3 * i + 2] = 0; - pa[3 * (N + i)] = stations[i]; - pa[3 * (N + i) + 1] = bottomPlaneOffsets[i]; - pa[3 * (N + i) + 2] = 0; - } - pos.needsUpdate = true; - - //Hull material - let phong = THREE.ShaderLib.phong; - let commonDecl = - "uniform float wlThreshold;uniform vec3 aboveWL; uniform vec3 belowWL;\nvarying vec3 vPos;"; - let hMat = new THREE.ShaderMaterial({ - uniforms: THREE.UniformsUtils.merge([ - phong.uniforms, - { - wlThreshold: new THREE.Uniform( - ship.designState.calculationParameters.Draft_design / Depth - ), - aboveWL: new THREE.Uniform(new THREE.Color(0x33aa33)), - belowWL: new THREE.Uniform(new THREE.Color(0xaa3333)) - } - ]), - vertexShader: - commonDecl + - phong.vertexShader - .replace("main() {", "main() {\nvPos = position.xyz;") - .replace("#define PHONG", ""), - fragmentShader: - commonDecl + - phong.fragmentShader - .replace( - "vec4 diffuseColor = vec4( diffuse, opacity );", - "vec4 diffuseColor = vec4( (vPos.z>wlThreshold)? aboveWL.rgb : belowWL.rgb, opacity );" - ) - .replace("#define PHONG", ""), - side: THREE.DoubleSide, - lights: true, - transparent: true - }); - hMat.uniforms.opacity.value = 0.5; - - let hullGroup = new THREE.Group(); - let port = new THREE.Mesh(hGeom, hMat); - let starboard = new THREE.Mesh(hGeom, hMat); - starboard.scale.y = -1; - hullGroup.add(port, starboard); - - //Caps: - hullGroup.add(new THREE.Mesh(bowCapG, hMat)); - hullGroup.add(new THREE.Mesh(aftCapG, hMat)); - hullGroup.add(new THREE.Mesh(bottomCapG, hMat)); - - hullGroup.scale.set(LOA, 0.5 * BOA, Depth); - this.hullGroup = hullGroup; - this.add(hullGroup); - - //DEBUG, to show only hull: - //return; - - //Decks: - var decks = new THREE.Group(); - let deckMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: 0.2, - side: THREE.DoubleSide - }); - //deckGeom.translate(0,0,-0.5); - let ds = ship.structure.decks; - let dk = Object.keys(ds); - let stss = stations.map(st => LOA * st); //use scaled stations for now - console.log(dk); - for (let i = 0; i < dk.length; i++) { - let d = ds[dk[i]]; //deck in ship structure - - //Will eventually use BoxBufferGeometry, but that is harder, because vertices are duplicated in the face planes. - let deckGeom = new THREE.PlaneBufferGeometry(1, 1, stss.length, 1); //new THREE.BoxBufferGeometry(1,1,1,sts.length,1,1); - console.log("d.zFloor=%.1f", d.zFloor); //DEBUG - let zHigh = d.zFloor; - let zLow = d.zFloor - d.thickness; - let wlHigh = hull.getWaterline(zHigh); - let wlLow = hull.getWaterline(zLow); - let pos = deckGeom.getAttribute("position"); - let pa = pos.array; - for (let j = 0; j < stss.length + 1; j++) { - let x = d.xAft + (j / stss.length) * (d.xFwd - d.xAft); - let y1 = Vessel.f.linearFromArrays(stss, wlHigh, x); - let y2 = Vessel.f.linearFromArrays(stss, wlLow, x); - let y = Math.min(0.5 * d.breadth, y1, y2); - pa[3 * j] = x; - pa[3 * j + 1] = y; - pa[3 * (stss.length + 1) + 3 * j] = x; - pa[3 * (stss.length + 1) + 3 * j + 1] = -y; //test - } - pos.needsUpdate = true; - - //DEBUG - console.log( - "d.xFwd=%.1f, d.xAft=%.1f, 0.5*d.breadth=%.1f", - d.xFwd, - d.xAft, - 0.5 * d.breadth - ); - console.log(pa); - - let deck = new THREE.Mesh(deckGeom, deckMat); - deck.name = dk[i]; - deck.position.z = d.zFloor; - //deck.scale.set(d.xFwd-d.xAft, d.breadth, d.thickness); - //deck.position.set(0.5*(d.xFwd+d.xAft), 0, d.zFloor); - decks.add(deck); - } - this.decks = decks; - this.add(decks); - - //Bulkheads: - var bulkheads = new THREE.Group(); - // Individually trimmed geometries like the decks @ferrari212 - let bhMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - let bhs = ship.structure.bulkheads; - let maxWl = Math.max(...hull.halfBreadths.waterlines) * Depth; - //let bhk = Object.keys(bhs); - //for (let i = 0; i < bhk.length; i++) { - for (let bhk in bhs) { - let bh = bhs[bhk]; //bhs[bhk[i]]; - let mat = bhMat; - let station = hull.getStation(bh.xAft); - - if (bh.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof bh.style.color !== "undefined" ? bh.style.color : 0xcccccc, - transparent: true, - opacity: - typeof bh.style.opacity !== "undefined" - ? bh.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - - let bulkheadGeom = new THREE.PlaneBufferGeometry( - maxWl, - BOA, - station.length - 1, - 1 - ); - - let pos = bulkheadGeom.getAttribute("position"); - let pa = pos.array; - - for (let i = 0; i < station.length; i++) { - // Check height in order to trim the bulkhead in the deck - if (pa[3 * i] < Depth - maxWl / 2) { - pa[3 * i + 1] = station[i]; - pa[3 * station.length + 3 * i + 1] = -station[i]; - } else { - pa[3 * i + 1] = pa[3 * station.length + 3 * i + 1] = 0; - } - } - pos.needsUpdate = true; - let bulkhead = new THREE.Mesh(bulkheadGeom, mat); - - bulkhead.name = bhk; //[i]; - - // The try verification is used to verify if the group affiliation was inserted in the JSON structure, - // the affiliation must be decided in the future if it will be incorporate into the main structure of the group - // or if there is a better approach to classify it. - // @ferrari212 - try { - bulkhead.group = bh.affiliations.group; - } catch (error) { - console.warn('Group tag were introduced to bulkhead object'); - console.warn(error); - } - - bulkhead.rotation.y = -Math.PI / 2; - bulkhead.position.set(bh.xAft, 0, maxWl / 2); - bulkheads.add(bulkhead); - } - this.bulkheads = bulkheads; - this.cmContainer.add(bulkheads); - - //Objects - - this.materials = {}; - this.stlPath = stlPath; - let stlManager = new THREE.LoadingManager(); - this.stlLoader = new THREE.STLLoader(stlManager); - /*stlManager.onLoad = function() { - createGUI(materials, deckMat); - }*/ - - this.blocks = new THREE.Group(); - this.add(this.blocks); - - //Default placeholder geometry - this.boxGeom = new THREE.BoxBufferGeometry(1, 1, 1); - this.boxGeom.translate(0, 0, 0.5); - - let objects = Object.values(ship.derivedObjects); - for (let i = 0; i < objects.length; i++) { - this.addObject(objects[i]); - } - - //console.log("Reached end of Ship3D constructor."); - } - Ship3D.prototype = Object.create(THREE.Group.prototype); - Object.assign(Ship3D.prototype, { - constructor: Ship3D, - addObject: function(object) { - let mat; - let name = this.stripName(object.id); - if (this.materials[name] !== undefined) { - mat = this.materials[name]; - } else { - mat = new THREE.MeshPhongMaterial({ - color: this.randomColor(), - transparent: true, - opacity: 0.5 - }); - this.materials[name] = mat; - } - - let bo = object.baseObject; - - //Position - let s = this.ship.designState.getObjectState(object); - let x = s.xCentre; - let y = s.yCentre; - let z = s.zBase; - - //Scale - let d = bo.boxDimensions; - - if (bo.file3D) { - let self = this; - this.stlLoader.load( - this.stlPath + "/" + bo.file3D, - function onLoad(geometry) { - //Normalize: - geometry.computeBoundingBox(); - let b = geometry.boundingBox; - geometry.translate(-b.min.x, -b.min.y, -b.min.z); - geometry.scale( - 1 / (b.max.x - b.min.x), - 1 / (b.max.y - b.min.y), - 1 / (b.max.z - b.min.z) - ); - //Align with the same coordinate system as placeholder blocks: - geometry.translate(-0.5, -0.5, 0); - let m = new THREE.Mesh(geometry, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - self.blocks.add(m); - }, - undefined, - function onError() { - //console.warn("Specified file " + e.File + " not found. Falling back on placeholder."); - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - ); - } else { - //Placeholder: - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - }, - //this function is used as a temporary hack to group similar objects by color - stripName: function(s) { - s = s.replace(/[0-9]/g, ""); - s = s.trim(); - return s; - }, - randomColor: function() { - let r = Math.round(Math.random() * 0xff); - let g = Math.round(Math.random() * 0xff); - let b = Math.round(Math.random() * 0xff); - return (r << 16) | (g << 8) | b; - } - }); - - return Ship3D; -} - - -function _22(md){return( -md`### Libraries` -)} - -function _Vessel(require){return( -require('ntnu-vessel@0.1.1/vessel.js').catch(() => window["Vessel"]) -)} - -async function _THREE(require) -{ - const THREE = window.THREE = await require("three@0.99.0/build/three.min.js"); - await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {}); - await require("three@0.99.0/examples/js/loaders/STLLoader.js").catch(() => {}); - return THREE; -} - - -function _d3(require){return( -require("d3@5") -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["md"], _2); - main.variable(observer("Gunnerus")).define("Gunnerus", _Gunnerus); - main.variable(observer()).define(["md"], _4); - main.variable(observer()).define(["md"], _5); - main.variable(observer()).define(["Gunnerus"], _6); - main.variable(observer()).define(["Gunnerus"], _7); - main.variable(observer()).define(["md"], _8); - main.variable(observer()).define(["Gunnerus"], _9); - main.variable(observer()).define(["Gunnerus"], _10); - main.variable(observer()).define(["Gunnerus"], _11); - main.variable(observer()).define(["Gunnerus"], _12); - main.variable(observer()).define(["md"], _13); - main.variable(observer("ship")).define("ship", ["Vessel","Gunnerus"], _ship); - main.variable(observer("ship3D")).define("ship3D", ["Ship3D","ship"], _ship3D); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D"], _16); - main.variable(observer()).define(["md"], _17); - main.variable(observer()).define(["md"], _18); - main.variable(observer()).define(["md"], _19); - main.variable(observer()).define(["md"], _20); - main.variable(observer("Ship3D")).define("Ship3D", ["THREE","Vessel"], _Ship3D); - main.variable(observer()).define(["md"], _22); - main.variable(observer("Vessel")).define("Vessel", ["require"], _Vessel); - main.variable(observer("THREE")).define("THREE", ["require"], _THREE); - main.variable(observer("d3")).define("d3", ["require"], _d3); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/index.html b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/index.html deleted file mode 100644 index 9bcce21..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Chapter 2 - From GA to Blocks - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/index.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/index.js deleted file mode 100644 index cd5ccb2..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./c53e95309e85a5e2@344.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/package.json b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/package.json deleted file mode 100644 index 6210e43..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/chapter-2-from-ga-to-blocks", - "main": "c53e95309e85a5e2@344.js", - "version": "344.0.0", - "homepage": "https://observablehq.com/@ferrari212/chapter-2-from-ga-to-blocks", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-2/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/README.md b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/README.md deleted file mode 100644 index 44d15be..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Chapter 3 - Principles of System Engineering Applied to Gunnerus - -https://observablehq.com/@ferrari212/chapter-3-principles-of-system-engineering-applied-to-gunn@56 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/ffd9de1252b975ac@56.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/chapter-3-principles-of-system-engineering-applied-to-gunn"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/ffd9de1252b975ac@56.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/ffd9de1252b975ac@56.js deleted file mode 100644 index 7ba5f8d..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/ffd9de1252b975ac@56.js +++ /dev/null @@ -1,57 +0,0 @@ -// https://observablehq.com/@ferrari212/chapter-3-principles-of-system-engineering-applied-to-gunn@56 -function _1(md){return( -md`# Chapter 3 - Principles of System Engineering Applied to Gunnerus` -)} - -function _2(md){return( -md `[System Engineering](https://en.wikipedia.org/wiki/Systems_engineering) is a project managing approach which aims to develop an operable system capable of meeting the requirements defined by the stakeholders with the identification in a holistic approach of the several conflicts, relations and constrains between its different parts. **[1]** - - - -A part is a single unit element that only in the interaction with other parts can produce the desirable result and increase the value of the objects, forming then a system. The parts can constitute of people, hardware, software, facilities, policies, and documents depending of system nature considered. - - - -A ship can be considered as a system, being constitute of different parts which the System Engineering concept can help to identify the several conflicts between the elements. To give a simple example about elements interaction take the directional and propulsion subsystems, an increasing in the propulsive power can signify an increasing in the rudder system to compensate the momentum variation necessary to maintain the same maneuverability goal. Similarly, an alteration in the rudder system, such as the rudder size increasing for a better stability control, also requires an increasing in the propulsive power to compensate the extra drag force produced. - - - -In this Chapter, it is going to be discussed: - -* The graphical user interfaces (GUI) to improve the interability with the visualization; -* A Ship systems classification using the System Engineering approach; -* An interactive visualization between the parts. - - -The GUI can be applied for several other applications as well, and the library **[2]** has several examples about how to use them for simulation purpose. - -` -)} - -function _3(md){return( -md ` - [<< Previous](../section-2-2/index.html) || Top || [Next >>](../section-3-1/index.html) -` -)} - -function _4(md){return( -md`### References` -)} - -function _5(md){return( -md` -**[1] NASA System Engineering Handbook ** – National Aeronautics and Space Adminstration, Washington, D.C. - -**[2] Vessel.js ** - Lybrary Website [http://vesseljs.org/](https://shiplab.github.io/vesseljs/) -` -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["md"], _2); - main.variable(observer()).define(["md"], _3); - main.variable(observer()).define(["md"], _4); - main.variable(observer()).define(["md"], _5); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/index.html b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/index.html deleted file mode 100644 index b0073fb..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Chapter 3 - Principles of System Engineering Applied to Gunnerus - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/index.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/index.js deleted file mode 100644 index dd569f4..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./ffd9de1252b975ac@56.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/package.json b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/package.json deleted file mode 100644 index 06485b5..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/chapter-3-principles-of-system-engineering-applied-to-gunn", - "main": "ffd9de1252b975ac@56.js", - "version": "56.0.0", - "homepage": "https://observablehq.com/@ferrari212/chapter-3-principles-of-system-engineering-applied-to-gunn", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-3/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/README.md b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/README.md deleted file mode 100644 index 17e7d84..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Chapter 4 - Simulations and Analysis Principles for Vessel.js - -https://observablehq.com/@ferrari212/chapter-4-simulations-and-analysis-principles-for-vessel-j@56 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/ee558559d24181fc@56.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/chapter-4-simulations-and-analysis-principles-for-vessel-j"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/ee558559d24181fc@56.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/ee558559d24181fc@56.js deleted file mode 100644 index db37efb..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/ee558559d24181fc@56.js +++ /dev/null @@ -1,48 +0,0 @@ -// https://observablehq.com/@ferrari212/chapter-4-simulations-and-analysis-principles-for-vessel-j@56 -function _1(md){return( -md`# Chapter 4 - Simulations and Analysis Principles for Vessel.js` -)} - -function _2(md){return( -md`Simulations and Analysis in Naval Architecture is held to predict the system behavior in different scenarios according to situations faced during previews operation for improvements purpose or regulatory approval requirements. The level of details in the simulations during the design phase also permits the user to identify earlier failure and avoid the components over dimension, averting unnecessary costs with material and labor **[1]**. - -In this report is used the terminology applied in **[2]**, which relates the engineering analysis with its foundations in Newtonian mechanics as a way to find a cause effect relation. The simulation differs slightly from the analysis by inserting the time as a variant for the performance evaluation. - -On this chapter we are going to introduce how to use the Vessel.js **[3]** lybrary to create simulations and analysis, using its predefined models. This chapter will be separated according to the following topics: - -* Coordinate reference system; -* Advance Resistance Analysis; -* A Brief Explanation of Maneuvering Mathematical Model. -` -)} - -function _3(md){return( -md` - [<< Previous](../section-3-2/index.html) || Top || [Next >>](../section-4-1/index.html) -` -)} - -function _4(md){return( -md`### References` -)} - -function _5(md){return( -md` -**[1] Designing a Web Platform for Digital Twin Ship ** - Felipe Ferrari, Mater Thesis in the Norwegian University of Science and Technology, Juni 2021. - -**[2] Merging Physics, Big Data Analytics and Simulation for the Next-Generation Digital Twins ** - Stein Ove Erikstad, September 2017 - https://www.researchgate.net/publication - -**[3] Vessel.js ** - Lybrary Website http://vesseljs.org/ -` -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["md"], _2); - main.variable(observer()).define(["md"], _3); - main.variable(observer()).define(["md"], _4); - main.variable(observer()).define(["md"], _5); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/index.html b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/index.html deleted file mode 100644 index db1b7c7..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Chapter 4 - Simulations and Analysis Principles for Vessel.js - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/index.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/index.js deleted file mode 100644 index cf7965f..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./ee558559d24181fc@56.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/package.json b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/package.json deleted file mode 100644 index 5f4b784..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/chapter-4-simulations-and-analysis-principles-for-vessel-j", - "main": "ee558559d24181fc@56.js", - "version": "56.0.0", - "homepage": "https://observablehq.com/@ferrari212/chapter-4-simulations-and-analysis-principles-for-vessel-j", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/chapter-4/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/index.html b/examples/observable_examples/from_concept_to_simulation_intro/index.html deleted file mode 100644 index 59de755..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -From Concept to Simulation - A vessel.js tutorial - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/index.js b/examples/observable_examples/from_concept_to_simulation_intro/index.js deleted file mode 100644 index d34d5de..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./6383409a326255b7@214.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/package.json b/examples/observable_examples/from_concept_to_simulation_intro/package.json deleted file mode 100644 index 1cb31f5..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/from-the-hull-to-simulation-a-vessel-js-tutorial", - "main": "6383409a326255b7@214.js", - "version": "214.0.0", - "homepage": "https://observablehq.com/@ferrari212/from-the-hull-to-simulation-a-vessel-js-tutorial", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/0ef08910361ca44c@286.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/0ef08910361ca44c@286.js deleted file mode 100644 index 255b060..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/0ef08910361ca44c@286.js +++ /dev/null @@ -1,1887 +0,0 @@ -function _1(md){return( -md` -# Section 2.2 - Compartments - -On this section we will continue to explore the general arrangement, defining the compartments inside the ship. So far, it was already defined Deck plates and bulkheads location. -` -)} - -function _2(md){return( -md` -### Compartments Identification - -Two variables defines the compartments in Gunnerus.baseObjects and Gunnerus.derivedObjects. The Base Objects have information regarding the compartment, for example, its lenghts, weights and cg. The Derived Objects is related to its relationship to the whole vessel such as the location. -` -)} - -function _Gunnerus(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "pink", - "lowerColor": "grey", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - "Deck_A": { - "zFloor": 6.686, - "thickness": 0.1, - "xAft": 15.500, - "xFwd": 35.600, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - }, - "Deck_1": { - "zFloor": 4.286, - "thickness": 0.1, - "xAft": 0, - "xFwd": 33.680, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - } - }, - "bulkheads": { - "AB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "GB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "B23": { - "xAft": 22.00, - "thickness": 0.1, - "density": 7850 - }, - "FB": { - "xAft": 31.5, - "thickness": 0.1, - "density": 7850 - } - } - }, - "baseObjects": [{ - "id": "", - "affiliations": {}, - "boxDimensions": { - "length": "", - "breadth": "", - "height": "" - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": .5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - }], - - "derivedObjects": [{ - "id": "", - "baseObject": "", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": "", - "yCentre": "", - "zBase": "" - } - }] - -} -)} - -function _4(Gunnerus){return( -Gunnerus.baseObjects -)} - -function _5(Gunnerus){return( -Gunnerus.derivedObjects -)} - -function _6(md){return( -md` -Every base and derived object will have an identification (id.) that is linked to each other. The engine room is going to be used for the for exemplification about how each compartment is defined starting by definition of its ids: -` -)} - -function _7(Gunnerus){return( -Gunnerus.derivedObjects[0].id = "Engine Room" -)} - -function _8(Gunnerus){return( -Gunnerus.baseObjects[0].id = "engine_room.stl" -)} - -function _9(Gunnerus){return( -Gunnerus.derivedObjects[0].baseObject = "engine_room.stl" -)} - -function _10(md){return( -md` -### Compartments Dimensions and Location - -The locations of the compartment are defined in the Derived Objects Gunnerus.derivedObjects in the position of reference state (xCentre, yCentre, zBase): -` -)} - -function _11(Gunnerus){return( -Gunnerus.derivedObjects[0].referenceState = { - "xCentre": 13.25, - "yCentre": 0, - "zBase": 2.385 - } -)} - -function _12(md){return( -md` -The dimensions of the compartment are defined in the Base Objects Gunnerus.baseObjects in the position of reference state (length, breadth, height): -` -)} - -function _13(Gunnerus){return( -Gunnerus.baseObjects[0].boxDimensions = { - "length": 11.5, - "breadth": 9.6, - "height": 4.576 - } -)} - -function _14(md){return( -md` -Now it is possible to create the 3D model of defined compartments: -` -)} - -function _15(Gunnerus){return( -Gunnerus.baseObjects[0] -)} - -function _ship(Vessel,Gunnerus){return( -new Vessel.Ship(Gunnerus) -)} - -function _ship3D(Ship3D,ship){return( -new Ship3D(ship) -)} - -function* _18(THREE,width,ship,invalidation,ship3D) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(LOA / 2, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _19(md){return( -md` -### Gunnerus Compartments - -After the explanation about how to insert compartments into the model we can now define the compartments inside using our model ship Gunnerus. The necessary information about the sizes and location of each compartment is described in the table below: - - -` -)} - -function _Gunnerus2(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "pink", - "lowerColor": "grey", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - "Deck_A": { - "zFloor": 6.686, - "thickness": 0.1, - "xAft": 15.500, - "xFwd": 35.600, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - }, - "Deck_1": { - "zFloor": 4.286, - "thickness": 0.1, - "xAft": 0, - "xFwd": 33.680, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - } - }, - "bulkheads": { - "AB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "GB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "B23": { - "xAft": 22.00, - "thickness": 0.1, - "density": 7850 - }, - "FB": { - "xAft": 31.5, - "thickness": 0.1, - "density": 7850 - } - } - }, - "baseObjects": [{ - "id": "engine_room.stl", - "affiliations": {}, - "boxDimensions": { - "length": 11.5, - "breadth": 9.6, - "height": 4.576 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "cargo_hold.stl", - "affiliations": {}, - "boxDimensions": { - "length": 2.5, - "breadth": 7.6, - "height": 2.0 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "control_room.stl", - "affiliations": {}, - "boxDimensions": { - "length": 2.9, - "breadth": 6.575, - "height": 2.273 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "conf_room.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.9, - "breadth": 2.191, - "height": 2.658 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_4pers_1.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.9, - "breadth": 2.191, - "height": 2.658 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_4pers_2.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.9, - "breadth": 2.191, - "height": 2.658 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_4pers_3.stl", - "affiliations": {}, - "boxDimensions": { - "length": 4.34, - "breadth": 2.573, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_4pers_4.stl", - "affiliations": {}, - "boxDimensions": { - "length": 5.3, - "breadth": 3.422, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_4pers_5.stl", - "affiliations": {}, - "boxDimensions": { - "length": 5.3, - "breadth": 3.422, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Linen.stl", - "affiliations": {}, - "boxDimensions": { - "length": 1.75, - "breadth": 3.4, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Dry_Prov.stl", - "affiliations": {}, - "boxDimensions": { - "length": 2.05, - "breadth": 4.829, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Weath_Prot.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.2, - "breadth": 4.8, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Wet_Lab.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.8, - "breadth": 4.15, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Wardrobe_wash.stl", - "affiliations": {}, - "boxDimensions": { - "length": 6.625, - "breadth": 2.825, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Store_workshop.stl", - "affiliations": {}, - "boxDimensions": { - "length": 6.625, - "breadth": 2.15, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Dry_lab.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.3, - "breadth": 4.15, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Data_lab.stl", - "affiliations": {}, - "boxDimensions": { - "length": 4.3, - "breadth": 3.2, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_1pers_1.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.15, - "breadth": 4.938, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Masters.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.21, - "breadth": 4.134, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Cabins_1pers_2.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.648, - "breadth": 4.134, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Bath_1.stl", - "affiliations": {}, - "boxDimensions": { - "length": 1.416, - "breadth": 3.695, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Vent_El.stl", - "affiliations": {}, - "boxDimensions": { - "length": 3.75, - "breadth": 5.225, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Bath_2.stl", - "affiliations": {}, - "boxDimensions": { - "length": 2.09, - "breadth": 0.95, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Conf_room.stl", - "affiliations": {}, - "boxDimensions": { - "length": 6.16, - "breadth": 6.7, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Disp_Lock.stl", - "affiliations": {}, - "boxDimensions": { - "length": 0.815, - "breadth": 3.79, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - },{ - "id": "Whell_House.stl", - "affiliations": {}, - "boxDimensions": { - "length": 6.17, - "breadth": 6.7, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [0, 0, 0] - } - }], - "derivedObjects": [{ - "id": "Propulsion room", - "baseObject": "engine_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 13.25, - "yCentre": 0, - "zBase": 2.385 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "cargo_hold", - "baseObject": "cargo_hold.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 3.75, - "yCentre": 0, - "zBase": 3.576 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "control_room", - "baseObject": "control_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 16.55, - "yCentre": -1.512, - "zBase": 3.411 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "conf_room", - "baseObject": "conf_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 20.050, - "yCentre": -0.109, - "zBase": 3.270 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_4pers_1", - "baseObject": "Cabins_4pers_1.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 20.050, - "yCentre": -3.704, - "zBase": 3.270 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_4pers_2", - "baseObject": "Cabins_4pers_2.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 20.050, - "yCentre": 3.704, - "zBase": 3.270 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_4pers_3", - "baseObject": "Cabins_4pers_3.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.356, - "yCentre": 0.129, - "zBase": 3.520 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_4pers_4", - "baseObject": "Cabins_4pers_4.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.720, - "yCentre": 2.759, - "zBase": 3.520 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_4pers_5", - "baseObject": "Cabins_4pers_5.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 25.114, - "yCentre": -2.704, - "zBase": 3.520 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Linen", - "baseObject": "Linen.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 28.461, - "yCentre": -2.032, - "zBase": 3.520 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Dry_Prov", - "baseObject": "Dry_Prov.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 30.500, - "yCentre": 0.000, - "zBase": 3.520 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Weath_Prot", - "baseObject": "Weath_Prot.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 14.916, - "yCentre": -2.324, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Wet_Lab", - "baseObject": "Wet_Lab.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 18.550, - "yCentre": -2.575, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Wardrobe_wash", - "baseObject": "Wardrobe_wash.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 19.782, - "yCentre": 0.962, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Store_workshop", - "baseObject": "Store_workshop.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 19.782, - "yCentre": 3.575, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Dry_lab", - "baseObject": "Dry_lab.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 22.151, - "yCentre": -2.575, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Data_lab", - "baseObject": "Data_lab.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 26.053, - "yCentre": -3.009, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_1pers_1", - "baseObject": "Cabins_1pers_1.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 29.875, - "yCentre": -1.861, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Masters", - "baseObject": "Masters.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.582, - "yCentre": 2.571, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Cabins_1pers_2", - "baseObject": "Cabins_1pers_2.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.582, - "yCentre": 2.571, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Bath_1", - "baseObject": "Bath_1.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 30.685, - "yCentre": 2.232, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Vent_El", - "baseObject": "Vent_El.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 18.559, - "yCentre": 0.785, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Bath_2", - "baseObject": "Bath_2.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 19.445, - "yCentre": -2.875, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Conf_room", - "baseObject": "Conf_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 23.619, - "yCentre": 0.000, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Disp_Lock", - "baseObject": "Disp_Lock.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 27.163, - "yCentre": -1.410, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - },{ - "id": "Whell_House", - "baseObject": "Whell_House.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 17.500, - "yCentre": 0.000, - "zBase": 10.614 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - } -] -} -)} - -function _ship2(Vessel,Gunnerus2){return( -new Vessel.Ship(Gunnerus2) -)} - -function _ship3D2(Ship3D,ship2){return( -new Ship3D(ship2) -)} - -function* _23(THREE,width,ship,invalidation,ship3D2) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(LOA / 2, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D2); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _24(md){return( -md ` - [<< Previous](../chapter-2/index.html) || Top || [Next >>](../section-2-3/index.html) -` -)} - -function _25(md){return( -md`### References` -)} - -function _26(md){return( -md ` -**[1] Structure Definition ** – -Icaro Fonseca [/@icarofonseca/hull-definition-and-hydrostatics](https://observablehq.com/@icarofonseca/hull-definition-and-hydrostatics) - -**[2] Object Visualization ** – -Icaro Fonseca [/@icarofonseca/object-visualization](https://observablehq.com/@icarofonseca/object-visualization) -` -)} - -function _27(md){return( -md`### Snippets` -)} - -function _Ship3D(THREE,Vessel) -{ - //@EliasHasle - - /* -THREE.js Object3D constructed from Vessel.js Ship object. - -There are some serious limitations to this: -1. null values encountered are assumed to be either at the top or bottom of the given station. -2. The end caps and bulkheads are sometimes corrected with zeros where they should perhaps have been clipped because of null values. -*/ - - //var hMat; //global for debugging - - function Ship3D(ship, stlPath, deckOpacity = 0.2, objectOpacity = 0.5) { - THREE.Group.call(this); - - this.ship = ship; - - this.normalizer = new THREE.Group(); - this.fluctCont = new THREE.Group(); - this.fluctCont.rotation.order = "ZYX"; //right? - this.cmContainer = new THREE.Group(); - this.fluctCont.add(this.cmContainer); - this.normalizer.add(this.fluctCont); - this.add(this.normalizer); - let hull = ship.structure.hull; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //console.log("LOA:%.1f, BOA:%.1f, Depth:%.1f",LOA,BOA,Depth); - - this.position.z = -ship.designState.calculationParameters.Draft_design; - - //Hull - let stations = hull.halfBreadths.stations; - let waterlines = hull.halfBreadths.waterlines; - let table = hull.halfBreadths.table; - //None of these are changed during correction of the geometry. - - console.log(stations); - console.log(waterlines); - console.log(table); - - let N = stations.length; - let M = waterlines.length; - //Hull side, in principle Y offsets on an XZ plane: - //Even though a plane geometry is usually defined in terms of Z offsets on an XY plane, the order of the coordinates for each vertex is not so important. What is important is to get the topology right. This is ensured by working with the right order of the vertices. - let hGeom = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - M - 1 - ); - let pos = hGeom.getAttribute("position"); - let pa = pos.array; - - //loop1: - //zs - let c = 0; - //Iterate over waterlines - for (let j = 0; j < M; j++) { - //loop2: - //xs - //iterate over stations - for (let i = 0; i < N; i++) { - //if (table[j][i] === null) continue;// loop1; - pa[c] = stations[i]; //x - //DEBUG, OK. No attempts to read outside of table - /*if(typeof table[j] === "undefined") console.error("table[%d] is undefined", j); - else if (typeof table[j][i] === "undefined") console.error("table[%d][%d] is undefined", j, i);*/ - //y - pa[c + 1] = table[j][i]; //y - pa[c + 2] = waterlines[j]; //z - c += 3; - } - } - //console.error("c-pa.length = %d", c-pa.length); //OK, sets all cells - - //Get rid of nulls by merging their points with the closest non-null point in the same station: - /*I am joining some uvs too. Then an applied texture will be cropped, not distorted, where the hull is cropped.*/ - let uv = hGeom.getAttribute("uv"); - let uva = uv.array; - //Iterate over stations - for (let i = 0; i < N; i++) { - let firstNumberJ; - let lastNumberJ; - //Iterate over waterlines - let j; - for (j = 0; j < M; j++) { - let y = table[j][i]; - //If this condition is satisfied (number found), - //the loop will be quitted - //after the extra logic below: - if (y !== null) { - firstNumberJ = j; - lastNumberJ = j; - //copy vector for i,j to positions for all null cells below: - let c = firstNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (firstNumberJ > 0) { - firstNumberJ--; - d -= N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - break; - } - console.log("null encountered."); - } - - //Continue up the hull (with same j counter), searching for upper number. This does not account for the existence of numbers above the first null encountered. - for (; j < M; j++) { - let y = table[j][i]; - if (y === null) { - console.log("null encountered."); - break; - } - //else not null: - lastNumberJ = j; - } - - //copy vector for i,j to positions for all null cells above: - let c = lastNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (lastNumberJ < M - 1) { - lastNumberJ++; - d += N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - ////////// - } - - //console.log(pa); - - pos.needsUpdate = true; - uv.needsUpdate = true; - hGeom.computeVertexNormals(); - - //Bow cap: - let bowPlaneOffsets = hull.getStation(LOA).map(str => str / (0.5 * BOA)); //normalized - let bowCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = bowCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 1; - pa[3 * (2 * j) + 1] = bowPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 1; - pa[3 * (2 * j + 1) + 1] = -bowPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Aft cap: - let aftPlaneOffsets = hull.getStation(0).map(str => str / (0.5 * BOA)); //normalized - let aftCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = aftCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 0; - pa[3 * (2 * j) + 1] = -aftPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 0; - pa[3 * (2 * j + 1) + 1] = aftPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Bottom cap: - let bottomPlaneOffsets = hull.getWaterline(0).map(hw => hw / (0.5 * BOA)); //normalized - let bottomCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - 1 - ); - pos = bottomCapG.getAttribute("position"); - pa = pos.array; - //constant z-offset xy plane - for (let i = 0; i < N; i++) { - pa[3 * i] = stations[i]; - pa[3 * i + 1] = -bottomPlaneOffsets[i]; - pa[3 * i + 2] = 0; - pa[3 * (N + i)] = stations[i]; - pa[3 * (N + i) + 1] = bottomPlaneOffsets[i]; - pa[3 * (N + i) + 2] = 0; - } - pos.needsUpdate = true; - - //Hull material - let phong = THREE.ShaderLib.phong; - let commonDecl = - "uniform float wlThreshold;uniform vec3 aboveWL; uniform vec3 belowWL;\nvarying vec3 vPos;"; - let hMat = new THREE.ShaderMaterial({ - uniforms: THREE.UniformsUtils.merge([ - phong.uniforms, - { - wlThreshold: new THREE.Uniform( - ship.designState.calculationParameters.Draft_design / Depth - ), - aboveWL: new THREE.Uniform(new THREE.Color(0x33aa33)), - belowWL: new THREE.Uniform(new THREE.Color(0xaa3333)) - } - ]), - vertexShader: - commonDecl + - phong.vertexShader - .replace("main() {", "main() {\nvPos = position.xyz;") - .replace("#define PHONG", ""), - fragmentShader: - commonDecl + - phong.fragmentShader - .replace( - "vec4 diffuseColor = vec4( diffuse, opacity );", - "vec4 diffuseColor = vec4( (vPos.z>wlThreshold)? aboveWL.rgb : belowWL.rgb, opacity );" - ) - .replace("#define PHONG", ""), - side: THREE.DoubleSide, - lights: true, - transparent: true - }); - hMat.uniforms.opacity.value = 0.5; - - let hullGroup = new THREE.Group(); - let port = new THREE.Mesh(hGeom, hMat); - let starboard = new THREE.Mesh(hGeom, hMat); - starboard.scale.y = -1; - hullGroup.add(port, starboard); - - //Caps: - hullGroup.add(new THREE.Mesh(bowCapG, hMat)); - hullGroup.add(new THREE.Mesh(aftCapG, hMat)); - hullGroup.add(new THREE.Mesh(bottomCapG, hMat)); - - hullGroup.scale.set(LOA, 0.5 * BOA, Depth); - this.hullGroup = hullGroup; - this.add(hullGroup); - - //DEBUG, to show only hull: - //return; - - //Decks: - var decks = new THREE.Group(); - let deckMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: 0.2, - side: THREE.DoubleSide - }); - //deckGeom.translate(0,0,-0.5); - let ds = ship.structure.decks; - let dk = Object.keys(ds); - let stss = stations.map(st => LOA * st); //use scaled stations for now - console.log(dk); - for (let i = 0; i < dk.length; i++) { - let d = ds[dk[i]]; //deck in ship structure - - //Will eventually use BoxBufferGeometry, but that is harder, because vertices are duplicated in the face planes. - let deckGeom = new THREE.PlaneBufferGeometry(1, 1, stss.length, 1); //new THREE.BoxBufferGeometry(1,1,1,sts.length,1,1); - console.log("d.zFloor=%.1f", d.zFloor); //DEBUG - let zHigh = d.zFloor; - let zLow = d.zFloor - d.thickness; - let wlHigh = hull.getWaterline(zHigh); - let wlLow = hull.getWaterline(zLow); - let pos = deckGeom.getAttribute("position"); - let pa = pos.array; - for (let j = 0; j < stss.length + 1; j++) { - let x = d.xAft + (j / stss.length) * (d.xFwd - d.xAft); - let y1 = Vessel.f.linearFromArrays(stss, wlHigh, x); - let y2 = Vessel.f.linearFromArrays(stss, wlLow, x); - let y = Math.min(0.5 * d.breadth, y1, y2); - pa[3 * j] = x; - pa[3 * j + 1] = y; - pa[3 * (stss.length + 1) + 3 * j] = x; - pa[3 * (stss.length + 1) + 3 * j + 1] = -y; //test - } - pos.needsUpdate = true; - - //DEBUG - console.log( - "d.xFwd=%.1f, d.xAft=%.1f, 0.5*d.breadth=%.1f", - d.xFwd, - d.xAft, - 0.5 * d.breadth - ); - console.log(pa); - - let deck = new THREE.Mesh(deckGeom, deckMat); - deck.name = dk[i]; - deck.position.z = d.zFloor; - //deck.scale.set(d.xFwd-d.xAft, d.breadth, d.thickness); - //deck.position.set(0.5*(d.xFwd+d.xAft), 0, d.zFloor); - decks.add(deck); - } - this.decks = decks; - this.add(decks); - - //Bulkheads: - var bulkheads = new THREE.Group(); - // Individually trimmed geometries like the decks @ferrari212 - let bhMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - let bhs = ship.structure.bulkheads; - let maxWl = Math.max(...hull.halfBreadths.waterlines) * Depth; - //let bhk = Object.keys(bhs); - //for (let i = 0; i < bhk.length; i++) { - for (let bhk in bhs) { - let bh = bhs[bhk]; //bhs[bhk[i]]; - let mat = bhMat; - let station = hull.getStation(bh.xAft); - - if (bh.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof bh.style.color !== "undefined" ? bh.style.color : 0xcccccc, - transparent: true, - opacity: - typeof bh.style.opacity !== "undefined" - ? bh.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - - let bulkheadGeom = new THREE.PlaneBufferGeometry( - maxWl, - BOA, - station.length - 1, - 1 - ); - - let pos = bulkheadGeom.getAttribute("position"); - let pa = pos.array; - - for (let i = 0; i < station.length; i++) { - // Check height in order to trim the bulkhead in the deck - if (pa[3 * i] < Depth - maxWl / 2) { - pa[3 * i + 1] = station[i]; - pa[3 * station.length + 3 * i + 1] = -station[i]; - } else { - pa[3 * i + 1] = pa[3 * station.length + 3 * i + 1] = 0; - } - } - pos.needsUpdate = true; - let bulkhead = new THREE.Mesh(bulkheadGeom, mat); - - bulkhead.name = bhk; //[i]; - - // The try verification is used to verify if the group affiliation was inserted in the JSON structure, - // the affiliation must be decided in the future if it will be incorporate into the main structure of the group - // or if there is a better approach to classify it. - // @ferrari212 - try { - bulkhead.group = bh.affiliations.group; - } catch (error) { - console.warn('Group tag were introduced to bulkhead object'); - console.warn(error); - } - - bulkhead.rotation.y = -Math.PI / 2; - bulkhead.position.set(bh.xAft, 0, maxWl / 2); - bulkheads.add(bulkhead); - } - this.bulkheads = bulkheads; - this.cmContainer.add(bulkheads); - - //Objects - - this.materials = {}; - this.stlPath = stlPath; - let stlManager = new THREE.LoadingManager(); - this.stlLoader = new THREE.STLLoader(stlManager); - /*stlManager.onLoad = function() { - createGUI(materials, deckMat); - }*/ - - this.blocks = new THREE.Group(); - this.add(this.blocks); - - //Default placeholder geometry - this.boxGeom = new THREE.BoxBufferGeometry(1, 1, 1); - this.boxGeom.translate(0, 0, 0.5); - - let objects = Object.values(ship.derivedObjects); - for (let i = 0; i < objects.length; i++) { - this.addObject(objects[i]); - } - - //console.log("Reached end of Ship3D constructor."); - } - Ship3D.prototype = Object.create(THREE.Group.prototype); - Object.assign(Ship3D.prototype, { - constructor: Ship3D, - addObject: function(object) { - let mat; - let name = this.stripName(object.id); - if (this.materials[name] !== undefined) { - mat = this.materials[name]; - } else { - mat = new THREE.MeshPhongMaterial({ - color: this.randomColor(), - transparent: true, - opacity: 0.5 - }); - this.materials[name] = mat; - } - - let bo = object.baseObject; - - //Position - let s = this.ship.designState.getObjectState(object); - let x = s.xCentre; - let y = s.yCentre; - let z = s.zBase; - - //Scale - let d = bo.boxDimensions; - - if (bo.file3D) { - let self = this; - this.stlLoader.load( - this.stlPath + "/" + bo.file3D, - function onLoad(geometry) { - //Normalize: - geometry.computeBoundingBox(); - let b = geometry.boundingBox; - geometry.translate(-b.min.x, -b.min.y, -b.min.z); - geometry.scale( - 1 / (b.max.x - b.min.x), - 1 / (b.max.y - b.min.y), - 1 / (b.max.z - b.min.z) - ); - //Align with the same coordinate system as placeholder blocks: - geometry.translate(-0.5, -0.5, 0); - let m = new THREE.Mesh(geometry, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - self.blocks.add(m); - }, - undefined, - function onError() { - //console.warn("Specified file " + e.File + " not found. Falling back on placeholder."); - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - ); - } else { - //Placeholder: - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - }, - //this function is used as a temporary hack to group similar objects by color - stripName: function(s) { - s = s.replace(/[0-9]/g, ""); - s = s.trim(); - return s; - }, - randomColor: function() { - let r = Math.round(Math.random() * 0xff); - let g = Math.round(Math.random() * 0xff); - let b = Math.round(Math.random() * 0xff); - return (r << 16) | (g << 8) | b; - } - }); - - return Ship3D; -} - - -function _29(md){return( -md`### Libraries` -)} - -function _Vessel(require){return( -require('ntnu-vessel@0.1.1/vessel.js').catch(() => window["Vessel"]) -)} - -async function _THREE(require) -{ - const THREE = window.THREE = await require("three@0.99.0/build/three.min.js"); - await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {}); - await require("three@0.99.0/examples/js/loaders/STLLoader.js").catch(() => {}); - return THREE; -} - - -function _d3(require){return( -require("d3@5") -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer()).define(["md"], _2); - main.variable(observer("Gunnerus")).define("Gunnerus", _Gunnerus); - main.variable(observer()).define(["Gunnerus"], _4); - main.variable(observer()).define(["Gunnerus"], _5); - main.variable(observer()).define(["md"], _6); - main.variable(observer()).define(["Gunnerus"], _7); - main.variable(observer()).define(["Gunnerus"], _8); - main.variable(observer()).define(["Gunnerus"], _9); - main.variable(observer()).define(["md"], _10); - main.variable(observer()).define(["Gunnerus"], _11); - main.variable(observer()).define(["md"], _12); - main.variable(observer()).define(["Gunnerus"], _13); - main.variable(observer()).define(["md"], _14); - main.variable(observer()).define(["Gunnerus"], _15); - main.variable(observer("ship")).define("ship", ["Vessel","Gunnerus"], _ship); - main.variable(observer("ship3D")).define("ship3D", ["Ship3D","ship"], _ship3D); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D"], _18); - main.variable(observer()).define(["md"], _19); - main.variable(observer("Gunnerus2")).define("Gunnerus2", _Gunnerus2); - main.variable(observer("ship2")).define("ship2", ["Vessel","Gunnerus2"], _ship2); - main.variable(observer("ship3D2")).define("ship3D2", ["Ship3D","ship2"], _ship3D2); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D2"], _23); - main.variable(observer()).define(["md"], _24); - main.variable(observer()).define(["md"], _25); - main.variable(observer()).define(["md"], _26); - main.variable(observer()).define(["md"], _27); - main.variable(observer("Ship3D")).define("Ship3D", ["THREE","Vessel"], _Ship3D); - main.variable(observer()).define(["md"], _29); - main.variable(observer("Vessel")).define("Vessel", ["require"], _Vessel); - main.variable(observer("THREE")).define("THREE", ["require"], _THREE); - main.variable(observer("d3")).define("d3", ["require"], _d3); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/README.md b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/README.md deleted file mode 100644 index 9401535..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Section 2.2 - Compartments - -https://observablehq.com/@ferrari212/chapter-2-from-ga-to-blocks/2@286 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/0ef08910361ca44c@286.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/chapter-2-from-ga-to-blocks/2"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/index.html b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/index.html deleted file mode 100644 index 0cc7b6e..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Section 2.2 - Compartments - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/index.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/index.js deleted file mode 100644 index 2dfda01..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./0ef08910361ca44c@286.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/package.json b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/package.json deleted file mode 100644 index f0975f0..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/chapter-2-from-ga-to-blocks/2", - "main": "0ef08910361ca44c@286.js", - "version": "286.0.0", - "homepage": "https://observablehq.com/@ferrari212/chapter-2-from-ga-to-blocks/2", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-2/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/9eb8e36a1ec635ca@244.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/9eb8e36a1ec635ca@244.js deleted file mode 100644 index 4e9fc2b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/9eb8e36a1ec635ca@244.js +++ /dev/null @@ -1,1929 +0,0 @@ -// https://observablehq.com/@ferrari212/section-2-2-tanks@244 -async function _1(md,FileAttachment){return( -md` -# Section 2.3 - Tanks - -Similarly from the compartments we can define the tanks in relation to its identification name, dimensions and locations. The tanks, however, must contain a defined center of gravity, a lightweight, volume capacities, content density, and a fullness that will be defined in Gunnerus.baseObjects. - -The following arrengement of the top tanks can help to identify each space of the tanks: - - - - Top side figure. - - -The following table indicates the center of gravity and volume of each compartment: - - ${await FileAttachment("tank_pos.png").image()} - Image: Position of the tanks - - -Simillarly to the [Section 2.2](./section-2-2/index.html) it is going to be used one of the main tanks, in this case the the oil tank 8.No6.sb.FO.#20-A.settl, as example for explaining each step of the tank definition. The final 3D drawing with all the tanks involved will be made after the explanation. -` -)} - -function _2(FileAttachment){return( -FileAttachment("tank_pos.png") -)} - -function _Gunnerus(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "pink", - "lowerColor": "grey", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": {}, - "bulkheads": {} - }, - "baseObjects": [{ - "id": "", - "affiliations": {}, - "boxDimensions": { - "length": "", - "breadth": "", - "height": "" - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 0, - "volumeCapacity": 0, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0, 0.25, 0.5, 0.75, 1], - "cgs": [ - [0, 0, 0], - [0, 0, 0], - [0, 0, 0], - [0, 0, 0], - [0, 0, 0] - ] - } - } - }], - - "derivedObjects": [{ - "id": "", - "baseObject": "", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": "", - "yCentre": "", - "zBase": "" - } - }] - -} -)} - -function _4(md){return( -md` -### Postion on derived objects - -The location of the tanks must be informed in Gunnerus.derivedObjects. Similarly to the compartments we must use inside the derived objects an identification that relates with the base object. The ids and locations are described bellow: -` -)} - -function _5(Gunnerus){return( -Gunnerus.derivedObjects[0].id = "Tank8" -)} - -function _6(Gunnerus){return( -Gunnerus.derivedObjects[0].baseObject = "8.No6.sb.FO.#20-A.settl" -)} - -function _7(Gunnerus){return( -Gunnerus.derivedObjects[0].referenceState = {xCentre: 13.102, yCentre: -0.904, zBase: 0.627} -)} - -function _8(md){return( -md` -### Defining the center of gravity in Base Objects - -Differently from the compartments, the base objects in tanks not only specify its dimensions but relates the center of gravity with fullness of the tank. The volume capacity and content density are also defined in the based objects, here it is shown for the example of oil tank: -` -)} - -function _9(Gunnerus){return( -Gunnerus.baseObjects[0].id = "8.No6.sb.FO.#20-A.settl" -)} - -function _10(Gunnerus){return( -Gunnerus.baseObjects[0].boxDimensions = {length: 4.000, breadth: 1.875, height: 1.400} -)} - -function _11(Gunnerus){return( -Gunnerus.baseObjects[0].weightInformation.contentDensity = 830 -)} - -function _12(Gunnerus){return( -Gunnerus.baseObjects[0].weightInformation.volumeCapacity = 7.783 -)} - -function _13(md){return( -md` -Regarding the fullness mapping in the tank it is necessary to relate the tank fullness with the position of the center of gravity at the specific fullness. The fullness is a array with the considered percentages and the center of gravity is a matrix with the specific positions in (x, y, z): -` -)} - -function _14(Gunnerus){return( -Gunnerus.baseObjects[0].weightInformation.fullnessCGMapping.fullnesses = [0.00, 0.25, 0.49, 0.74, 1.00] -)} - -function _15(Gunnerus){return( -Gunnerus.baseObjects[0].weightInformation.fullnessCGMapping.cgs = [ - [13.18, 0.29, -0.1], - [12.4, 0.8, 0.22], - [12.21, 0.87, 0.35], - [12.14, 0.89, 0.49], - [12.1, 0.9, 0.63] - ] -)} - -function _16(Gunnerus){return( -Gunnerus.baseObjects[0] -)} - -function _ship(Vessel,Gunnerus){return( -new Vessel.Ship(Gunnerus) -)} - -function _ship3D(Ship3D,ship){return( -new Ship3D(ship) -)} - -function* _19(THREE,width,ship,invalidation,ship3D) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(LOA / 2, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _20(md){return( -md` -### Gunnerus with all tanks - -The whole compartments are ploted bellow as usual after each step in the report: -` -)} - -function _Gunnerus2(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "pink", - "lowerColor": "grey", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": {}, - "bulkheads": {} - }, - "baseObjects": [{ - "id": "20.CargoHold.#2-8", - "affiliations": {}, - "boxDimensions": { - "length": 3.000, - "breadth": 7.600, - "height": 2.000 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 0, - "volumeCapacity": 37.820, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.28, 0.51, 0.76, 1.00], - "cgs": [ - [3.01, 0.00, 2.11], - [2.81, 0.00, 2.44], - [2.75, 0.00, 2.67], - [2.73, 0.00, 2.91], - [2.71, 0.00, 3.14] - ] - } - } - },{ - "id": "2.No2.sb.FO.#40-48", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 3.724, - "height": 0.796 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 11.852, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.26, 0.53, 0.74, 1.00], - "cgs": [ - [25.72, -0.35, 0.28], - [26.53, -1.04, 0.73], - [26.61, -1.23, 0.95], - [26.64, -1.31, 1.10], - [26.67, -1.38, 1.26] - ] - } - } - },{ - "id": "3.No2.p.FO.#40-48", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 3.724, - "height": 0.796 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 11.852, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.26, 0.53, 0.74, 1.00], - "cgs": [ - [25.72, 0.35, 0.28], - [26.53, 1.04, 0.73], - [26.61, 1.23, 0.95], - [26.64, 1.31, 1.10], - [26.67, 1.38, 1.26] - ] - } - } - },{ - "id": "8.No6.sb.FO.#20-A.settl", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 1.875, - "height": 1.400 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 7.783, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.25, 0.49, 0.74, 1.00], - "cgs": [ - [13.18, -0.29, -0.1], - [12.4, -0.8, 0.22], - [12.21, -0.87, 0.35], - [12.14, -0.89, 0.49], - [12.10, -0.9, 0.63] - ] - } - } - },{ - "id": "9.No6.p.FO.#20-A", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 1.875, - "height": 1.400 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 7.783, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.25, 0.49, 0.74, 1.00], - "cgs": [ - [13.18, 0.29, -0.1], - [12.4, 0.8, 0.22], - [12.21, 0.87, 0.35], - [12.14, 0.89, 0.49], - [12.10, 0.9, 0.63] - ] - } - } - },{ - "id": "15.No11.sb.FO.#17-20.serv", - "affiliations": {}, - "boxDimensions": { - "length": 1.500, - "breadth": 0.700, - "height": 2.107 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 2.212, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.24, 0.48, 0.74, 1.00], - "cgs": [ - [9.25, -4.15, 1.66], - [9.25, -4.15, 1.92], - [9.25, -4.15, 2.18], - [9.25, -4.15, 2.46], - [9.25, -4.15, 2.74] - ] - } - } - },{ - "id": "16.No11.p.FO.#16-19.serv", - "affiliations": {}, - "boxDimensions": { - "length": 1.500, - "breadth": 0.700, - "height": 2.107 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 2.212, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0, 0.25, 0.52, 0.74, 1.00], - "cgs": [ - [9.85, 4.15, 1.66], - [9.85, 4.15, 1.93], - [9.85, 4.15, 2.22], - [9.85, 4.15, 2.46], - [9.85, 4.15, 2.74] - ] - } - } - },{ - "id": "24.No15.sb.FO.#A-I", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 1.875, - "height": 1.255 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 8.244, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.27, 0.56, 0.76, 1.00], - "cgs": [ - [15.90, -0.26, 0.09], - [16.85, -0.82, 0.23], - [16.93, -0.88, 0.40], - [16.95, -0.90, 0.51], - [17.02, -0.91, 0.64] - ] - } - } - },{ - "id": "25.No15.p.FO.#A-I", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 1.875, - "height": 1.255 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 8.244, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.27, 0.56, 0.76, 1.00], - "cgs": [ - [15.90, 0.26, 0.09], - [16.85, 0.82, 0.23], - [16.93, 0.88, 0.40], - [16.95, 0.90, 0.51], - [17.02, 0.91, 0.64] - ] - } - } - },{ - "id": "1.No1.#48-51.TW", - "affiliations": {}, - "boxDimensions": { - "length": 1.500, - "breadth": 4.263, - "height": 1.469 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 8.244, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.26, 0.54, 0.74, 1.00], - "cgs": [ - [30.56, 0.00, 0.42], - [30.68, 0.00, 0.79], - [30.69, 0.00, 1.01], - [30.70, 0.00, 1.14], - [30.70, 0.00, 1.30] - ] - } - } - },{ - "id": "4.No3.sb.#32-40", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 3.213, - "height": 0.995 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 12.789, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.23, 0.53, 0.78, 1.00], - "cgs": [ - [22.99, -1.7, 0.31], - [23.72, -2.26, 0.71], - [23.79, -2.47, 0.95], - [23.82, -2.56, 1.12], - [23.83, -2.62, 1.26] - ] - } - } - },{ - "id": "5.No3.p.#32-40", - "affiliations": {}, - "boxDimensions": { - "length": 4.000, - "breadth": 3.213, - "height": 0.995 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 12.789, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.23, 0.53, 0.78, 1.00], - "cgs": [ - [22.99, 1.70, 0.31], - [23.72, 2.26, 0.71], - [23.79, 2.47, 0.95], - [23.82, 2.56, 1.12], - [23.83, 2.62, 1.26] - ] - } - } - },{ - "id": "7.No5.#28-37.FW", - "affiliations": {}, - "boxDimensions": { - "length": 4.500, - "breadth": 2.800, - "height": 1.660 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 18.446, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.23, 0.53, 0.78, 1.00], - "cgs": [ - [20.96, 0.00, 0.07], - [22.02, 0.00, 0.43], - [22.07, 0.00, 0.61], - [22.09, 0.00, 0.78], - [22.33, 0.00, 0.95] - ] - } - } - },{ - "id": "17.No12.#", - "affiliations": {}, - "boxDimensions": { - "length": 1.500, - "breadth": 9.600, - "height": 1.500 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 21.167, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.24, 0.51, 0.75, 1.00], - "cgs": [ - [5.75, 0, 2.61], - [5.75, 0, 2.79], - [5.75, 0, 2.99], - [5.75, 0, 3.18], - [5.75, 0, 3.36] - ] - } - } - },{ - "id": "18.No13.sb.#", - "affiliations": {}, - "boxDimensions": { - "length": 3.000, - "breadth": 1.000, - "height": 2.000 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.961, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.24, 0.47, 0.77, 1.00], - "cgs": [ - [4.29, -4.01, 2.11], - [3.76, -4.19, 2.52], - [3.67, -4.24, 2.75], - [3.63, -4.27, 3.02], - [3.61, -4.28, 3.22] - ] - } - } - },{ - "id": "19.No13.p.#", - "affiliations": {}, - "boxDimensions": { - "length": 3.000, - "breadth": 1.000, - "height": 2.000 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.961, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.24, 0.47, 0.77, 1.00], - "cgs": [ - [4.29, 4.01, 2.11], - [3.76, 4.19, 2.52], - [3.67, 4.24, 2.75], - [3.63, 4.27, 3.02], - [3.61, 4.28, 3.22] - ] - } - } - },{ - "id": "6.No4.#37-40.Dry", - "affiliations": {}, - "boxDimensions": { - "length": 3.000, - "breadth": 1.000, - "height": 2.000 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 0, - "volumeCapacity": 4.372, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.22, 0.55, 0.78, 1.00], - "cgs": [ - [25.04, 0.00, 0.23], - [25.23, 0.37, 0.48], - [25.24, 0.42, 0.75], - [25.25, 0.43, 0.93], - [25.25, 0.43, 1.10] - ] - } - } - },{ - "id": "10.No7.sb.#22-26.Black.sew", - "affiliations": {}, - "boxDimensions": { - "length": 2.000, - "breadth": 1.656, - "height": 0.977 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.372, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.24, 0.53, 0.77, 1.00], - "cgs": [ - [12.45, 2.67, -0.12], - [12.96, 2.58, 0.26], - [12.98, 2.64, 0.41], - [12.99, 2.66, 0.54], - [12.99, 2.67, 0.66] - ] - } - } - },{ - "id": "11.No7.p.#22-26.Grey.sew", - "affiliations": {}, - "boxDimensions": { - "length": 2.000, - "breadth": 1.656, - "height": 0.977 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.372, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.24, 0.53, 0.77, 1.00], - "cgs": [ - [12.45, -2.67, 0.12], - [12.96, -2.58, -0.26], - [12.98, -2.64, -0.41], - [12.99, -2.66, -0.54], - [12.99, -2.67, -0.66] - ] - } - } - },{ - "id": "12.No8.#20-22.Sludge", - "affiliations": {}, - "boxDimensions": { - "length": 1.000, - "breadth": 1.650, - "height": 1.031 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 900, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.25, 0.50, 0.75, 1.00], - "cgs": [ - [11.33, -2.7, -0.18], - [11.49, -2.65, 0.19], - [11.49, -2.66, 0.34], - [11.50, -2.67, 0.49], - [11.50, -2.68, 0.62] - ] - } - } - },{ - "id": "13.No9.#18-20.Waste", - "affiliations": {}, - "boxDimensions": { - "length": 1.000, - "breadth": 1.650, - "height": 1.082 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 900, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.25, 0.50, 0.75, 1.00], - "cgs": [ - [10.34, -2.69, -0.25], - [10.48, -2.69, 0.1], - [10.49, -2.69, 0.29], - [10.50, -2.69, 0.44], - [10.50, -2.69, 0.59] - ] - } - } - },{ - "id": "14.No10.#18-22.Bilge", - "affiliations": {}, - "boxDimensions": { - "length": 2.000, - "breadth": 1.656, - "height": 1.053 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.25, 0.50, 0.75, 1.00], - "cgs": [ - [10.45, 2.69, -0.25], - [10.92, 2.68, 0.13], - [10.97, 2.67, 0.32], - [10.98, 2.68, 0.47], - [10.98, 2.68, 0.60] - ] - } - } - },{ - "id": "26.No14.sb.#28-32.Black.w", - "affiliations": {}, - "boxDimensions": { - "length": 2.000, - "breadth": 1.650, - "height": 0.889 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.26, 0.51, 0.70, 1.00], - "cgs": [ - [15.56, -2.14, 0.08], - [15.95, -2.56, 0.36], - [15.98, -2.63, 0.48], - [15.98, -2.65, 0.57], - [15.99, -2.66, 0.71] - ] - } - } - },{ - "id": "27.No14.p.#28-32.Grey.w", - "affiliations": {}, - "boxDimensions": { - "length": 2.000, - "breadth": 1.650, - "height": 0.889 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [0.00, 0.26, 0.51, 0.70, 1.00], - "cgs": [ - [15.56, 2.14, 0.08], - [15.95, 2.56, 0.36], - [15.98, 2.63, 0.48], - [15.98, 2.65, 0.57], - [15.99, 2.66, 0.71] - ] - } - } - }], - - "derivedObjects": [{ - "id": "Tank20", - "baseObject": "20.CargoHold.#2-8", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 3.714, - "yCentre": 0.000, - "zBase": 3.145 - } - },{ - "id": "Tank2", - "baseObject": "2.No2.sb.FO.#40-48", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 27.665, - "yCentre": -1.385, - "zBase": 1.259 - } - },{ - "id": "Tank3", - "baseObject": "3.No2.p.FO.#40-48", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 27.665, - "yCentre": 1.385, - "zBase": 1.259 - } - },{ - "id": "Tank8", - "baseObject": "8.No6.sb.FO.#20-A.settl", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 13.102, - "yCentre": -0.904, - "zBase": 0.627 - } - },{ - "id": "Tank9", - "baseObject": "9.No6.p.FO.#20-A", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 13.102, - "yCentre": 0.904, - "zBase": 0.627 - } - },{ - "id": "Tank15", - "baseObject": "15.No11.sb.FO.#17-20.serv", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 9.850, - "yCentre": -4.150, - "zBase": 2.738 - } - },{ - "id": "Tank16", - "baseObject": "16.No11.p.FO.#16-19.serv", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 9.850, - "yCentre": 4.150, - "zBase": 2.738 - } - },{ - "id": "Tank24", - "baseObject": "24.No15.sb.FO.#A-I", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 17.018, - "yCentre": -0.906, - "zBase": 0.645 - } - },{ - "id": "Tank25", - "baseObject": "25.No15.p.FO.#A-I", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 17.018, - "yCentre": 0.906, - "zBase": 0.645 - } - },{ - "id": "Tank01", - "baseObject": "1.No1.#48-51.TW", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 30.702, - "yCentre": 0, - "zBase": 1.297 - } - },{ - "id": "Tank04", - "baseObject": "4.No3.sb.#32-40", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 23.834, - "yCentre": -2.620, - "zBase": 1.260 - } - },{ - "id": "Tank05", - "baseObject": "5.No3.p.#32-40", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 23.834, - "yCentre": 2.620, - "zBase": 1.260 - } - },{ - "id": "Tank07", - "baseObject": "7.No5.#28-37.FW", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 22.330, - "yCentre": 0.000, - "zBase": 0.951 - } - },{ - "id": "Tank17", - "baseObject": "17.No12.#", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 5.751, - "yCentre": 0.000, - "zBase": 3.363 - } - },{ - "id": "Tank18", - "baseObject": "18.No13.sb.#", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 3.606, - "yCentre": -4.285, - "zBase": 3.225 - } - },{ - "id": "Tank19", - "baseObject": "19.No13.p.#", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 3.606, - "yCentre": 4.285, - "zBase": 3.225 - } - },{ - "id": "Tank6", - "baseObject": "6.No4.#37-40.Dry", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 25.246, - "yCentre": -0.432, - "zBase": 1.102 - } - },{ - "id": "Tank10", - "baseObject": "10.No7.sb.#22-26.Black.sew", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 12.992, - "yCentre": -2.669, - "zBase": 0.656 - } - },{ - "id": "Tank11", - "baseObject": "11.No7.p.#22-26.Grey.sew", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 12.992, - "yCentre": 2.669, - "zBase": 0.656 - } - },{ - "id": "Tank12", - "baseObject": "12.No8.#20-22.Sludge", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 11.497, - "yCentre": -2.680, - "zBase": 0.621 - } - },{ - "id": "Tank13", - "baseObject": "13.No9.#18-20.Waste", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 10.497, - "yCentre": -2.692, - "zBase": 0.587 - } - },{ - "id": "Tank14", - "baseObject": "14.No10.#18-22.Bilge", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 10.985, - "yCentre": 2.685, - "zBase": 0.603 - } - },{ - "id": "Tank27", - "baseObject": "27.No14.p.#28-32.Grey.w", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 15.988, - "yCentre": 2.664, - "zBase": 0.706 - } - }] -} -)} - -function _ship2(Vessel,Gunnerus2){return( -new Vessel.Ship(Gunnerus2) -)} - -function _ship3D2(Ship3D,ship2){return( -new Ship3D(ship2) -)} - -function* _24(THREE,width,ship,invalidation,ship3D2) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(LOA / 2, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D2); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _25(md){return( -md ` - [<< Previous](../section-2-2/index.html) || Top || [Next >>](../section-2-4/index.html) -` -)} - -function _26(md){return( -md`### References` -)} - -function _27(md){return( -md ` -**[1] Structure Definition ** – -Icaro Fonseca [/@icarofonseca/hull-definition-and-hydrostatics](https://observablehq.com/@icarofonseca/hull-definition-and-hydrostatics) - -**[2] Object Visualization ** – -Icaro Fonseca [/@icarofonseca/object-visualization](https://observablehq.com/@icarofonseca/object-visualization) -` -)} - -function _28(md){return( -md`### Snippets` -)} - -function _Ship3D(THREE,Vessel) -{ - //@EliasHasle - - /* -THREE.js Object3D constructed from Vessel.js Ship object. - -There are some serious limitations to this: -1. null values encountered are assumed to be either at the top or bottom of the given station. -2. The end caps and bulkheads are sometimes corrected with zeros where they should perhaps have been clipped because of null values. -*/ - - //var hMat; //global for debugging - - function Ship3D(ship, stlPath, deckOpacity = 0.2, objectOpacity = 0.5) { - THREE.Group.call(this); - - this.ship = ship; - - this.normalizer = new THREE.Group(); - this.fluctCont = new THREE.Group(); - this.fluctCont.rotation.order = "ZYX"; //right? - this.cmContainer = new THREE.Group(); - this.fluctCont.add(this.cmContainer); - this.normalizer.add(this.fluctCont); - this.add(this.normalizer); - let hull = ship.structure.hull; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //console.log("LOA:%.1f, BOA:%.1f, Depth:%.1f",LOA,BOA,Depth); - - this.position.z = -ship.designState.calculationParameters.Draft_design; - - //Hull - let stations = hull.halfBreadths.stations; - let waterlines = hull.halfBreadths.waterlines; - let table = hull.halfBreadths.table; - //None of these are changed during correction of the geometry. - - console.log(stations); - console.log(waterlines); - console.log(table); - - let N = stations.length; - let M = waterlines.length; - //Hull side, in principle Y offsets on an XZ plane: - //Even though a plane geometry is usually defined in terms of Z offsets on an XY plane, the order of the coordinates for each vertex is not so important. What is important is to get the topology right. This is ensured by working with the right order of the vertices. - let hGeom = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - M - 1 - ); - let pos = hGeom.getAttribute("position"); - let pa = pos.array; - - //loop1: - //zs - let c = 0; - //Iterate over waterlines - for (let j = 0; j < M; j++) { - //loop2: - //xs - //iterate over stations - for (let i = 0; i < N; i++) { - //if (table[j][i] === null) continue;// loop1; - pa[c] = stations[i]; //x - //DEBUG, OK. No attempts to read outside of table - /*if(typeof table[j] === "undefined") console.error("table[%d] is undefined", j); - else if (typeof table[j][i] === "undefined") console.error("table[%d][%d] is undefined", j, i);*/ - //y - pa[c + 1] = table[j][i]; //y - pa[c + 2] = waterlines[j]; //z - c += 3; - } - } - //console.error("c-pa.length = %d", c-pa.length); //OK, sets all cells - - //Get rid of nulls by merging their points with the closest non-null point in the same station: - /*I am joining some uvs too. Then an applied texture will be cropped, not distorted, where the hull is cropped.*/ - let uv = hGeom.getAttribute("uv"); - let uva = uv.array; - //Iterate over stations - for (let i = 0; i < N; i++) { - let firstNumberJ; - let lastNumberJ; - //Iterate over waterlines - let j; - for (j = 0; j < M; j++) { - let y = table[j][i]; - //If this condition is satisfied (number found), - //the loop will be quitted - //after the extra logic below: - if (y !== null) { - firstNumberJ = j; - lastNumberJ = j; - //copy vector for i,j to positions for all null cells below: - let c = firstNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (firstNumberJ > 0) { - firstNumberJ--; - d -= N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - break; - } - console.log("null encountered."); - } - - //Continue up the hull (with same j counter), searching for upper number. This does not account for the existence of numbers above the first null encountered. - for (; j < M; j++) { - let y = table[j][i]; - if (y === null) { - console.log("null encountered."); - break; - } - //else not null: - lastNumberJ = j; - } - - //copy vector for i,j to positions for all null cells above: - let c = lastNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (lastNumberJ < M - 1) { - lastNumberJ++; - d += N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - ////////// - } - - //console.log(pa); - - pos.needsUpdate = true; - uv.needsUpdate = true; - hGeom.computeVertexNormals(); - - //Bow cap: - let bowPlaneOffsets = hull.getStation(LOA).map(str => str / (0.5 * BOA)); //normalized - let bowCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = bowCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 1; - pa[3 * (2 * j) + 1] = bowPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 1; - pa[3 * (2 * j + 1) + 1] = -bowPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Aft cap: - let aftPlaneOffsets = hull.getStation(0).map(str => str / (0.5 * BOA)); //normalized - let aftCapG = new THREE.PlaneBufferGeometry(undefined, undefined, 1, M - 1); - pos = aftCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 0; - pa[3 * (2 * j) + 1] = -aftPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 0; - pa[3 * (2 * j + 1) + 1] = aftPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Bottom cap: - let bottomPlaneOffsets = hull.getWaterline(0).map(hw => hw / (0.5 * BOA)); //normalized - let bottomCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - 1 - ); - pos = bottomCapG.getAttribute("position"); - pa = pos.array; - //constant z-offset xy plane - for (let i = 0; i < N; i++) { - pa[3 * i] = stations[i]; - pa[3 * i + 1] = -bottomPlaneOffsets[i]; - pa[3 * i + 2] = 0; - pa[3 * (N + i)] = stations[i]; - pa[3 * (N + i) + 1] = bottomPlaneOffsets[i]; - pa[3 * (N + i) + 2] = 0; - } - pos.needsUpdate = true; - - //Hull material - let phong = THREE.ShaderLib.phong; - let commonDecl = - "uniform float wlThreshold;uniform vec3 aboveWL; uniform vec3 belowWL;\nvarying vec3 vPos;"; - let hMat = new THREE.ShaderMaterial({ - uniforms: THREE.UniformsUtils.merge([ - phong.uniforms, - { - wlThreshold: new THREE.Uniform( - ship.designState.calculationParameters.Draft_design / Depth - ), - aboveWL: new THREE.Uniform(new THREE.Color(0x33aa33)), - belowWL: new THREE.Uniform(new THREE.Color(0xaa3333)) - } - ]), - vertexShader: - commonDecl + - phong.vertexShader - .replace("main() {", "main() {\nvPos = position.xyz;") - .replace("#define PHONG", ""), - fragmentShader: - commonDecl + - phong.fragmentShader - .replace( - "vec4 diffuseColor = vec4( diffuse, opacity );", - "vec4 diffuseColor = vec4( (vPos.z>wlThreshold)? aboveWL.rgb : belowWL.rgb, opacity );" - ) - .replace("#define PHONG", ""), - side: THREE.DoubleSide, - lights: true, - transparent: true - }); - hMat.uniforms.opacity.value = 0.5; - - let hullGroup = new THREE.Group(); - let port = new THREE.Mesh(hGeom, hMat); - let starboard = new THREE.Mesh(hGeom, hMat); - starboard.scale.y = -1; - hullGroup.add(port, starboard); - - //Caps: - hullGroup.add(new THREE.Mesh(bowCapG, hMat)); - hullGroup.add(new THREE.Mesh(aftCapG, hMat)); - hullGroup.add(new THREE.Mesh(bottomCapG, hMat)); - - hullGroup.scale.set(LOA, 0.5 * BOA, Depth); - this.hullGroup = hullGroup; - this.add(hullGroup); - - //DEBUG, to show only hull: - //return; - - //Decks: - var decks = new THREE.Group(); - let deckMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: 0.2, - side: THREE.DoubleSide - }); - //deckGeom.translate(0,0,-0.5); - let ds = ship.structure.decks; - let dk = Object.keys(ds); - let stss = stations.map(st => LOA * st); //use scaled stations for now - console.log(dk); - for (let i = 0; i < dk.length; i++) { - let d = ds[dk[i]]; //deck in ship structure - - //Will eventually use BoxBufferGeometry, but that is harder, because vertices are duplicated in the face planes. - let deckGeom = new THREE.PlaneBufferGeometry(1, 1, stss.length, 1); //new THREE.BoxBufferGeometry(1,1,1,sts.length,1,1); - console.log("d.zFloor=%.1f", d.zFloor); //DEBUG - let zHigh = d.zFloor; - let zLow = d.zFloor - d.thickness; - let wlHigh = hull.getWaterline(zHigh); - let wlLow = hull.getWaterline(zLow); - let pos = deckGeom.getAttribute("position"); - let pa = pos.array; - for (let j = 0; j < stss.length + 1; j++) { - let x = d.xAft + (j / stss.length) * (d.xFwd - d.xAft); - let y1 = Vessel.f.linearFromArrays(stss, wlHigh, x); - let y2 = Vessel.f.linearFromArrays(stss, wlLow, x); - let y = Math.min(0.5 * d.breadth, y1, y2); - pa[3 * j] = x; - pa[3 * j + 1] = y; - pa[3 * (stss.length + 1) + 3 * j] = x; - pa[3 * (stss.length + 1) + 3 * j + 1] = -y; //test - } - pos.needsUpdate = true; - - //DEBUG - console.log( - "d.xFwd=%.1f, d.xAft=%.1f, 0.5*d.breadth=%.1f", - d.xFwd, - d.xAft, - 0.5 * d.breadth - ); - console.log(pa); - - let deck = new THREE.Mesh(deckGeom, deckMat); - deck.name = dk[i]; - deck.position.z = d.zFloor; - //deck.scale.set(d.xFwd-d.xAft, d.breadth, d.thickness); - //deck.position.set(0.5*(d.xFwd+d.xAft), 0, d.zFloor); - decks.add(deck); - } - this.decks = decks; - this.add(decks); - - //Bulkheads: - var bulkheads = new THREE.Group(); - // Individually trimmed geometries like the decks @ferrari212 - let bhMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - let bhs = ship.structure.bulkheads; - let maxWl = Math.max(...hull.halfBreadths.waterlines) * Depth; - //let bhk = Object.keys(bhs); - //for (let i = 0; i < bhk.length; i++) { - for (let bhk in bhs) { - let bh = bhs[bhk]; //bhs[bhk[i]]; - let mat = bhMat; - let station = hull.getStation(bh.xAft); - - if (bh.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof bh.style.color !== "undefined" ? bh.style.color : 0xcccccc, - transparent: true, - opacity: - typeof bh.style.opacity !== "undefined" - ? bh.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - - let bulkheadGeom = new THREE.PlaneBufferGeometry( - maxWl, - BOA, - station.length - 1, - 1 - ); - - let pos = bulkheadGeom.getAttribute("position"); - let pa = pos.array; - - for (let i = 0; i < station.length; i++) { - // Check height in order to trim the bulkhead in the deck - if (pa[3 * i] < Depth - maxWl / 2) { - pa[3 * i + 1] = station[i]; - pa[3 * station.length + 3 * i + 1] = -station[i]; - } else { - pa[3 * i + 1] = pa[3 * station.length + 3 * i + 1] = 0; - } - } - pos.needsUpdate = true; - let bulkhead = new THREE.Mesh(bulkheadGeom, mat); - - bulkhead.name = bhk; //[i]; - - // The try verification is used to verify if the group affiliation was inserted in the JSON structure, - // the affiliation must be decided in the future if it will be incorporate into the main structure of the group - // or if there is a better approach to classify it. - // @ferrari212 - try { - bulkhead.group = bh.affiliations.group; - } catch (error) { - console.warn('Group tag were introduced to bulkhead object'); - console.warn(error); - } - - bulkhead.rotation.y = -Math.PI / 2; - bulkhead.position.set(bh.xAft, 0, maxWl / 2); - bulkheads.add(bulkhead); - } - this.bulkheads = bulkheads; - this.cmContainer.add(bulkheads); - - //Objects - - this.materials = {}; - this.stlPath = stlPath; - let stlManager = new THREE.LoadingManager(); - this.stlLoader = new THREE.STLLoader(stlManager); - /*stlManager.onLoad = function() { - createGUI(materials, deckMat); - }*/ - - this.blocks = new THREE.Group(); - this.add(this.blocks); - - //Default placeholder geometry - this.boxGeom = new THREE.BoxBufferGeometry(1, 1, 1); - this.boxGeom.translate(0, 0, 0.5); - - let objects = Object.values(ship.derivedObjects); - for (let i = 0; i < objects.length; i++) { - this.addObject(objects[i]); - } - - //console.log("Reached end of Ship3D constructor."); - } - Ship3D.prototype = Object.create(THREE.Group.prototype); - Object.assign(Ship3D.prototype, { - constructor: Ship3D, - addObject: function(object) { - let mat; - let name = this.stripName(object.id); - if (this.materials[name] !== undefined) { - mat = this.materials[name]; - } else { - mat = new THREE.MeshPhongMaterial({ - color: this.randomColor(), - transparent: true, - opacity: 0.5 - }); - this.materials[name] = mat; - } - - let bo = object.baseObject; - - //Position - let s = this.ship.designState.getObjectState(object); - let x = s.xCentre; - let y = s.yCentre; - let z = s.zBase; - - //Scale - let d = bo.boxDimensions; - - if (bo.file3D) { - let self = this; - this.stlLoader.load( - this.stlPath + "/" + bo.file3D, - function onLoad(geometry) { - //Normalize: - geometry.computeBoundingBox(); - let b = geometry.boundingBox; - geometry.translate(-b.min.x, -b.min.y, -b.min.z); - geometry.scale( - 1 / (b.max.x - b.min.x), - 1 / (b.max.y - b.min.y), - 1 / (b.max.z - b.min.z) - ); - //Align with the same coordinate system as placeholder blocks: - geometry.translate(-0.5, -0.5, 0); - let m = new THREE.Mesh(geometry, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - self.blocks.add(m); - }, - undefined, - function onError() { - //console.warn("Specified file " + e.File + " not found. Falling back on placeholder."); - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - ); - } else { - //Placeholder: - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - this.blocks.add(m); - } - }, - //this function is used as a temporary hack to group similar objects by color - stripName: function(s) { - s = s.replace(/[0-9]/g, ""); - s = s.trim(); - return s; - }, - randomColor: function() { - let r = Math.round(Math.random() * 0xff); - let g = Math.round(Math.random() * 0xff); - let b = Math.round(Math.random() * 0xff); - return (r << 16) | (g << 8) | b; - } - }); - - return Ship3D; -} - - -function _30(md){return( -md`### Libraries` -)} - -function _Vessel(require){return( -require('ntnu-vessel@0.1.1/vessel.js').catch(() => window["Vessel"]) -)} - -async function _THREE(require) -{ - const THREE = window.THREE = await require("three@0.99.0/build/three.min.js"); - await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {}); - await require("three@0.99.0/examples/js/loaders/STLLoader.js").catch(() => {}); - return THREE; -} - - -function _d3(require){return( -require("d3@5") -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - function toString() { return this.url; } - const fileAttachments = new Map([ - ["tank_pos.png", {url: new URL("./files/image_two.png", import.meta.url), mimeType: "image/png", toString}], - ["tank.png", {url: new URL("./files/image_one.png", import.meta.url), mimeType: "image/png", toString}] - ]); - main.builtin("FileAttachment", runtime.fileAttachments(name => fileAttachments.get(name))); - main.variable(observer()).define(["md","FileAttachment"], _1); - main.variable(observer()).define(["FileAttachment"], _2); - main.variable(observer("Gunnerus")).define("Gunnerus", _Gunnerus); - main.variable(observer()).define(["md"], _4); - main.variable(observer()).define(["Gunnerus"], _5); - main.variable(observer()).define(["Gunnerus"], _6); - main.variable(observer()).define(["Gunnerus"], _7); - main.variable(observer()).define(["md"], _8); - main.variable(observer()).define(["Gunnerus"], _9); - main.variable(observer()).define(["Gunnerus"], _10); - main.variable(observer()).define(["Gunnerus"], _11); - main.variable(observer()).define(["Gunnerus"], _12); - main.variable(observer()).define(["md"], _13); - main.variable(observer()).define(["Gunnerus"], _14); - main.variable(observer()).define(["Gunnerus"], _15); - main.variable(observer()).define(["Gunnerus"], _16); - main.variable(observer("ship")).define("ship", ["Vessel","Gunnerus"], _ship); - main.variable(observer("ship3D")).define("ship3D", ["Ship3D","ship"], _ship3D); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D"], _19); - main.variable(observer()).define(["md"], _20); - main.variable(observer("Gunnerus2")).define("Gunnerus2", _Gunnerus2); - main.variable(observer("ship2")).define("ship2", ["Vessel","Gunnerus2"], _ship2); - main.variable(observer("ship3D2")).define("ship3D2", ["Ship3D","ship2"], _ship3D2); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D2"], _24); - main.variable(observer()).define(["md"], _25); - main.variable(observer()).define(["md"], _26); - main.variable(observer()).define(["md"], _27); - main.variable(observer()).define(["md"], _28); - main.variable(observer("Ship3D")).define("Ship3D", ["THREE","Vessel"], _Ship3D); - main.variable(observer()).define(["md"], _30); - main.variable(observer("Vessel")).define("Vessel", ["require"], _Vessel); - main.variable(observer("THREE")).define("THREE", ["require"], _THREE); - main.variable(observer("d3")).define("d3", ["require"], _d3); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/README.md b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/README.md deleted file mode 100644 index f83270e..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Section 2.3 - Tanks - -https://observablehq.com/@ferrari212/section-2-2-tanks@244 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/9eb8e36a1ec635ca@244.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/section-2-2-tanks"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/files/image_one.png b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/files/image_one.png deleted file mode 100644 index a8cb468..0000000 Binary files a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/files/image_one.png and /dev/null differ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/files/image_two.png b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/files/image_two.png deleted file mode 100644 index 30f9e6d..0000000 Binary files a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/files/image_two.png and /dev/null differ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/index.html b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/index.html deleted file mode 100644 index c443d51..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Section 2.3 - Tanks - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/index.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/index.js deleted file mode 100644 index 9d695c8..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./9eb8e36a1ec635ca@244.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/package.json b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/package.json deleted file mode 100644 index 2926f64..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/section-2-2-tanks", - "main": "9eb8e36a1ec635ca@244.js", - "version": "244.0.0", - "homepage": "https://observablehq.com/@ferrari212/section-2-2-tanks", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-3/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/README.md b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/README.md deleted file mode 100644 index c5c70f8..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Section 2.4 - Equipments and STL elements - -https://observablehq.com/@ferrari212/section-2-4-equipments-and-stl-elements@193 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/b6441b3891937553@193.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/section-2-4-equipments-and-stl-elements"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/b6441b3891937553@193.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/b6441b3891937553@193.js deleted file mode 100644 index 32f1d5a..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/b6441b3891937553@193.js +++ /dev/null @@ -1,1374 +0,0 @@ -// https://observablehq.com/@ferrari212/section-2-4-equipments-and-stl-elements@193 -function _1(md){return( -md` -# Section 2.4 - Equipments and STL elements - -In this section will be demonstrated how to catch 3D elements from an external source to represent the gunnerus equipment and how to set up the JSON configuration in order to read those elements properly. - -The structure of the 3D objects is similar to the identification of the Tanks, containing a derivedObject which points towards a specific baseObject containing the center of gravity and weights of the objects such as explained previously in [Section 2.3](./section-2-3/index.html). In fact, it is possible to import a tank with not squared geometry as a 3D model, therefore, the tanks and elements in the simulations have the same construction method. - -As usual, we are going to start with our basic Gunnerus module with a pre-setted object as explained in previously chapters: -` -)} - -function _Gunnerus(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "green", - "lowerColor": "pink", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - "Deck_A": { - "zFloor": 6.686, - "thickness": 0.1, - "xAft": 15.500, - "xFwd": 35.600, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - }, - "Deck_1": { - "zFloor": 4.286, - "thickness": 0.1, - "xAft": 0, - "xFwd": 33.680, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - } - }, - "bulkheads": { - "AB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "GB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "B23": { - "xAft": 22.00, - "thickness": 0.1, - "density": 7850 - }, - "FB": { - "xAft": 31.5, - "thickness": 0.1, - "density": 7850 - } - } - }, - "baseObjects": [{ - "id": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "affiliations": {}, - "boxDimensions": { - "length": 4.4725, - "breadth": 9.9732, - "height": 2.800 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 0, - "volumeCapacity": 0, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [0, 0, 1.45] - ] - } - } - }], - - "derivedObjects": [{ - "id": "SH_GROUP_A_FRAME_ROV_HANGAR", - "baseObject": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "affiliations": { - "Deck": "MainDeck", - "SFI": "302" - }, - "referenceState": { - "xCentre": 11.250, - "yCentre": 3.230, - "zBase": 4.286 - } - }] -} -)} - -function _3(md){return( -md -` -In the object we are going to assign the property file3D with the name of the 3D STL name in the folder: -` -)} - -function _4(Gunnerus){return( -Gunnerus.baseObjects[0].file3D = "SH_GROUP_A_FRAME_ROV_HANGAR.stl" -)} - -function _ship(Vessel,Gunnerus){return( -new Vessel.Ship(Gunnerus) -)} - -function _6(md){return( -md` -### Import from external URL - -To point out for an external reference it is required to insert the stlPath in the Ship3D constructor, in this case the stl file is located in git hub URL. The figure from the hangar will be read in the designed STLPath and added to the 3D element. -` -)} - -function _ship3D(Ship3D,ship){return( -new Ship3D(ship, { - shipState: ship.designState.clone(), - stlPath: "https://shiplab.github.io/vesseljs/examples/specs/STL%20files/Gunnerus", - upperColor: 0x33aa33, - lowerColor: 0xaa3333, - hullOpacity: 0.5, - deckOpacity: 0.5, - objectOpacity: 0.5 - }) -)} - -function* _8(THREE,width,ship,invalidation,ship3D) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50, aspect); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.3 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(0, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _9(md){return( -md` -Now we can import all STL drawings presented in the folder: -` -)} - -function _Gunnerus2(){return( -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": "", - "Draft_design": 2.787, - "Cb_design": "", - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data":{ - }, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [0, 0.075757576, 0.151515152, 0.227272727, 0.303030303, 0.378787879, 0.454545455, 0.53030303, 0.606060606, 0.681818182, 0.757575758, 0.833333333, 0.909090909, 0.984848485, 1.060606061, 1.136363636], - "stations": [0,0.016,0.032,0.048,0.064,0.08,0.096,0.112,0.128,0.144,0.16,0.176,0.192,0.208,0.224,0.24,0.256,0.272,0.288,0.304,0.32,0.336,0.352,0.368,0.384,0.4,0.416,0.432,0.448,0.464,0.48,0.496,0.512,0.528,0.544,0.56,0.576,0.592,0.608,0.624,0.64,0.656,0.672,0.688,0.704,0.72,0.736,0.752,0.768,0.784,0.8,0.816,0.832,0.848,0.864,0.88,0.896,0.912,0.928,0.944,0.96,0.976,0.992,1], - "table": [ - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,0,0,0.023706,0.04164,0.03956054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.071654682,0.218163956,0.347109355,0.707410528,0.7101572,0.714521886,0.724138946,0.749662831,0.771743418,0.78068812,0.777351611,0.760040588,0.734964599,0.707735189,0.67881251,0.649277089,0.619130809,0.588445384,0.557293752,0.525670827,0.493631236,0.461239013,0.428710429,0.396118672,0.36353124,0.331272913,0.29936175,0.267774887,0.236499989,0.205527382,0.174631462,0.143735542,0.112839584,0.082193712,0.05487704,0.035077082,0.017589529,0,0,0,null,null,null,null], - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11384365,0.28021182,0.731167857,0.731746877,0.733344981,0.761914571,0.813147939,0.852579142,0.879895833,0.900087484,0.914681498,0.92643748,0.932025146,0.935672912,0.936216634,0.933764547,0.928441671,0.920420837,0.909739482,0.894997965,0.876045837,0.853289591,0.827195791,0.798289439,0.767083232,0.733856099,0.698899943,0.66232254,0.6244297,0.585758311,0.546243642,0.506078186,0.46566391,0.425637487,0.386155955,0.347200012,0.308764165,0.270830841,0.233397929,0.196477089,0.160454165,0.126395671,0.095160357,0.062479974,0.026483334,0,null,null,null], - [0,0,0,0,0,0,0,0,0,0.11327781,0.229017497,0.352529385,0.726907379,0.733153683,0.734473511,0.777951228,0.839199655,0.886066097,0.918911876,0.94205339,0.958529154,0.970252075,0.97813029,0.98480835,0.986720886,0.988820801,0.990237529,0.987881165,0.985799968,0.982785339,0.978744609,0.974802669,0.967961121,0.957981974,0.945835368,0.932018738,0.914989624,0.894104207,0.870773824,0.844629517,0.81436259,0.780335897,0.743943736,0.706508331,0.668210297,0.627605692,0.586681264,0.545253652,0.503595835,0.461675008,0.419545822,0.380137227,0.340914586,0.301902084,0.26320811,0.227077077,0.196202088,0.165685272,0.135260417,0.099252084,0.034576791,0,null,null], - [0.14752927,0.195454496,0.252279943,0.315177918,0.380875676,0.453470815,0.617983921,0.652319055,0.685022602,0.755220845,0.814679074,0.864853715,0.904683419,0.933976734,0.955608678,0.971806987,0.983565004,0.991776358,0.996810839,0.999454025,1,1,1,1,1,1,1,1,1,0.999147848,0.996595208,0.994104207,0.987329,0.979657491,0.97008667,0.958017375,0.943480021,0.9264328,0.9066745,0.883690491,0.857092692,0.82629715,0.791246643,0.752603963,0.711764526,0.669355469,0.626193848,0.582815806,0.53950826,0.496612142,0.454332225,0.412979101,0.372598241,0.332724024,0.293440323,0.256938756,0.22273585,0.192366084,0.163749835,0.131338641,0.075224109,0,null,null], - [0.71273652,0.750030161,0.785739492,0.820259247,0.853601583,0.884948356,0.911901164,0.934555335,0.953122646,0.968269338,0.980177623,0.989221129,0.995597117,0.999145458,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000228327,0.999831136,0.996996663,0.991083171,0.983481242,0.974163818,0.962508952,0.948075765,0.93017568,0.908572693,0.88319224,0.854268494,0.821813507,0.785829519,0.74630839,0.70333669,0.657443237,0.610306346,0.562759501,0.51533193,0.468369497,0.422251841,0.377271449,0.333293279,0.290521571,0.25025678,0.212261035,0.176019681,0.143433533,0.111947466,0.036266209,0,null,null], - [0.952335345,0.962861851,0.972258259,0.98050379,0.987472892,0.992967483,0.996992105,0.999437767,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000711812,1.000223814,1.00008331,0.998717143,0.994425964,0.987480367,0.977858785,0.965194397,0.949268189,0.930027669,0.907345683,0.881151021,0.851564891,0.818550568,0.782004293,0.74175115,0.697687225,0.650243429,0.60079071,0.549806112,0.497353109,0.443579,0.388505936,0.332285614,0.275121256,0.217052256,0.158101082,0.098297354,0.03763231,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.000978704,1.000123929,1.000433223,1.000155476,0.999416911,0.995501404,0.988170878,0.977699076,0.964266358,0.948126119,0.929550883,0.908355306,0.883601888,0.854754435,0.822345988,0.78675532,0.747661845,0.704622091,0.657655182,0.607425537,0.553840688,0.494980367,0.430992991,0.362582372,0.286795248,0.1978427,0.094251874,0,0,0,0,0,null,null], - [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.001068035,1,1.000566031,1.00039981,1.000281179,0.99947703,0.995137939,0.987093404,0.976328634,0.963292135,0.948348999,0.931424764,0.911436564,0.887533163,0.860225016,0.830331319,0.797312826,0.759774933,0.717407786,0.670107066,0.618719839,0.563078613,0.499293365,0.426550725,0.345286535,0.254695028,0.152289454,0.017480884,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,0.999729513,0.996414083,0.989560649,0.97963918,0.966896769,0.951602071,0.934263814,0.91490153,0.893087565,0.868295797,0.839980214,0.807522888,0.770669708,0.729325714,0.683190002,0.631342366,0.572309723,0.503807678,0.424613749,0.34130806,0.251240946,0.145490374,0,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,0.999925334,0.997950745,0.992567851,0.983164063,0.969894918,0.955087891,0.938956604,0.92146698,0.900858866,0.876678263,0.849934998,0.818909353,0.78348053,0.742989451,0.696685028,0.64331131,0.580691935,0.509305827,0.431949565,0.348958842,0.256609065,0.147383639,0,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,0.999998322,0.998716489,0.993788889,0.984393858,0.972777127,0.960075558,0.94547464,0.928713592,0.909181324,0.887171689,0.861867913,0.832409779,0.797523504,0.757344436,0.710841863,0.656110741,0.593423712,0.522404885,0.445499657,0.359952898,0.262699446,0.140437139,0,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,0.999140523,0.994668884,0.98718811,0.978343506,0.967970174,0.954970703,0.939435832,0.92151418,0.901042074,0.876890157,0.848287506,0.813690542,0.773740489,0.727496134,0.673696035,0.610398814,0.53985021,0.460823301,0.369907043,0.261237583,0.110538737,0,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,0.999762066,0.997236826,0.99215781,0.985214537,0.976632629,0.966251998,0.953367201,0.93740136,0.917841809,0.894117416,0.865701622,0.83209896,0.792797394,0.747250891,0.693787412,0.631141856,0.558409942,0.474917611,0.377272279,0.256452988,0.050848489,null,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.999215596,0.996047872,0.991702983,0.986147868,0.978149109,0.967190552,0.952952576,0.934723714,0.912378031,0.885308228,0.852728526,0.814278564,0.770332743,0.716678162,0.652663829,0.578919932,0.492081858,0.388540567,0.252610601,0,null], - [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0.998391724,0.995362549,0.990088603,0.981777242,0.969780375,0.953738403,0.933355306,0.907830099,0.876827698,0.839707743,0.795846507,0.743832143,0.682505239,0.609659933,0.520594126,0.407894109,0.251062353,0] - ] - }, - "style": { - "upperColor": "green", - "lowerColor": "pink", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - "Deck_A": { - "zFloor": 6.686, - "thickness": 0.1, - "xAft": 15.500, - "xFwd": 35.600, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - }, - "Deck_1": { - "zFloor": 4.286, - "thickness": 0.1, - "xAft": 0, - "xFwd": 33.680, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - } - }, - "bulkheads": { - "AB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "GB": { - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "B23": { - "xAft": 22.00, - "thickness": 0.1, - "density": 7850 - }, - "FB": { - "xAft": 31.5, - "thickness": 0.1, - "density": 7850 - } - } - }, - "baseObjects": [{ - "id": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "affiliations": {}, - "boxDimensions": { - "length": 4.4725, - "breadth": 9.9732, - "height": 2.800 - }, - "capabilities": {}, - "file3D": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 23.915374075452302, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [0, 0, 1.45] - ] - } - } - },{ - "id": "NOGVA_Scania_bk.stl", - "affiliations": {}, - "boxDimensions": { - "length": 2.660, - "breadth": 1.273, - "height": 1.629 - }, - "capabilities": {}, - "file3D": "NOGVA_Scania_bk.stl", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 23.915374075452302, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [0, 0, 1.45] - ] - } - } - },{ - "id": "Pallfinger_Crane.stl", - "affiliations": {}, - "boxDimensions": { - "length": 21.327, - "breadth": 1.956, - "height": 3.271 - }, - "capabilities": {}, - "file3D": "Pallfinger_Crane.stl", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 23.915374075452302, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [0, 0, 1.45] - ] - } - } - }], - - "derivedObjects": [{ - "id": "SH_GROUP_A_FRAME_ROV_HANGAR", - "baseObject": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 11.250, - "yCentre": 3.230, - "zBase": 4.286 - } - },{ - "id": "NOGVA_Scania_bk_l", - "baseObject": "NOGVA_Scania_bk.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 10.790, - "yCentre": 2.297, - "zBase": 1.440 - } - },{ - "id": "NOGVA_Scania_bk_c", - "baseObject": "NOGVA_Scania_bk.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 10.790, - "yCentre": 0.000, - "zBase": 1.440 - } - },{ - "id": "NOGVA_Scania_bk_r", - "baseObject": "NOGVA_Scania_bk.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 10.790, - "yCentre": -2.297, - "zBase": 1.440 - } - },{ - "id": "Pallfinger_Crane", - "baseObject": "Pallfinger_Crane.stl", - "affiliations": { - "Deck": "Deck_A", - "SFI": "302" - }, - "referenceState": { - "xCentre": 5.824, - "yCentre": 3.795, - "zBase": 6.686 - } - }] -} -)} - -function _ship2(Vessel,Gunnerus2){return( -new Vessel.Ship(Gunnerus2) -)} - -function _ship3D2(Ship3D,ship2){return( -new Ship3D(ship2, { - shipState: ship2.designState.clone(), - stlPath: "https://shiplab.github.io/vesseljs/examples/specs/STL%20files/Gunnerus", - upperColor: 0x33aa33, - lowerColor: 0xaa3333, - hullOpacity: 0.5, - deckOpacity: 0.5, - objectOpacity: 0.5 - }) -)} - -function* _13(THREE,width,ship,invalidation,ship3D2) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50, aspect); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.3 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(0, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D2); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _14(md){return( -md` -It is noticeable as well that different derivedObjects can point towards the same baseObject if the same equipment repeat in the ship, for example, the engines which have three models on board: -` -)} - -function _15(Gunnerus2){return( -Gunnerus2.derivedObjects[1].baseObject == Gunnerus2.derivedObjects[2].baseObject && Gunnerus2.derivedObjects[2].baseObject == Gunnerus2.derivedObjects[3].baseObject -)} - -function _16(md){return( -md ` - [<< Previous](../section-2-3/index.html) || Top || [Next >>](../section-2-5/index.html) -` -)} - -function _17(md){return( -md`### References` -)} - -function _18(md){return( -md ` -**[1] Structure Definition ** – -Icaro Fonseca [/@icarofonseca/hull-definition-and-hydrostatics](https://observablehq.com/@icarofonseca/hull-definition-and-hydrostatics) - -**[2] Object Visualization ** – -Icaro Fonseca [/@icarofonseca/object-visualization](https://observablehq.com/@icarofonseca/object-visualization) -` -)} - -function _19(md){return( -md`### Snippets` -)} - -function _Ship3D(THREE,Vessel) -{ - //@EliasHasle - - /* -Draft for new version. More modularized, and interacts with a ship state. -Uses an additional coordinate system for motions. -The position.xy and rotation.z of the Ship3D object plae the ship in the 3D world. -(Not geographically) -position.z is the (negative) draft. -fluctCont is a "fluctuations container" to be used for dynamically -changing motions like heave, pitch, roll. -cmContainer centers the motion on the center of gravity. -normalizer nulls out the center of gravity height before the draft is applied. - - -THREE.js Object3D constructed from Vessel.js Ship object. - -There are some serious limitations to this: -1. null values encountered are assumed to be either at the top or bottom of the given station. -2. The end caps and bulkheads are sometimes corrected with zeros where they should perhaps have been clipped because of null values. - -TODO: Use calculated draft for position.z, and place the ship model in a motion container centered at the calculated metacenter. -*/ - - //var hMat; //global for debugging - - function Ship3D( - ship, - { shipState, stlPath, deckOpacity = 0.2, objectOpacity = 0.5 } - ) { - THREE.Group.call(this); - - this.normalizer = new THREE.Group(); - this.fluctCont = new THREE.Group(); - this.fluctCont.rotation.order = "ZYX"; //right? - this.cmContainer = new THREE.Group(); - this.fluctCont.add(this.cmContainer); - this.normalizer.add(this.fluctCont); - this.add(this.normalizer); - - Object.defineProperty(this, "draft", { - get: function() { - return -this.position.z; - } /*, - set: function(value) { - this.position.z = -value; - }*/ - }); - Object.defineProperty(this, "surge", { - get: function() { - return this.fluctCont.position.x; - }, - set: function(value) { - this.fluctCont.position.x = value; - //this.shipState.motion.surge = value; - } - }); - Object.defineProperty(this, "sway", { - get: function() { - return this.fluctCont.position.y; - }, - set: function(value) { - this.fluctCont.position.y = value; - //this.shipState.motion.sway = value; - } - }); - Object.defineProperty(this, "heave", { - get: function() { - return this.fluctCont.position.z; - }, - set: function(value) { - this.fluctCont.position.z = value; - //this.shipState.motion.heave = value; - } - }); - Object.defineProperty(this, "yaw", { - get: function() { - return this.fluctCont.rotation.z; - }, - set: function(value) { - this.fluctCont.rotation.z = value; - //this.shipState.motion.yaw = value; - } - }); - Object.defineProperty(this, "pitch", { - get: function() { - return this.fluctCont.rotation.y; - }, - set: function(value) { - this.fluctCont.rotation.y = value; - //this.shipState.motion.pitch = value; - } - }); - Object.defineProperty(this, "roll", { - get: function() { - return this.fluctCont.rotation.x; - }, - set: function(value) { - this.fluctCont.rotation.x = value; - //this.shipState.motion.roll = value; - } - }); - - this.objectOpacity = objectOpacity; - - this.ship = ship; - this.shipState = shipState || ship.designState.clone(); - - let hull = ship.structure.hull; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //console.log("LOA:%.1f, BOA:%.1f, Depth:%.1f",LOA,BOA,Depth); - let { - w: { cg, mass }, - T, - GMt, - GMl - } = ship.calculateStability(this.shipState); - - this.cmContainer.position.set(-cg.x, -cg.y, -cg.z); - this.normalizer.position.z = cg.z; - this.position.z = -T; - - let designDraft = ship.designState.calculationParameters.Draft_design; - this.hull3D = new Hull3D(hull, designDraft); - this.cmContainer.add(this.hull3D); - - //DEBUG, to show only hull: - //return; - - let stations = hull.halfBreadths.stations; - //Decks: - var decks = new THREE.Group(); - let deckMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - //deckGeom.translate(0,0,-0.5); - let ds = ship.structure.decks; - //let dk = Object.keys(ds); - let stss = stations.map(st => LOA * st); //use scaled stations for now - //console.log(dk); - //for (let i = 0; i < dk.length; i++) { - for (let dk in ds) { - //let d = ds[dk[i]]; //deck in ship structure - let d = ds[dk]; - - //Will eventually use BoxBufferGeometry, but that is harder, because vertices are duplicated in the face planes. - let deckGeom = new THREE.PlaneBufferGeometry(1, 1, stss.length, 1); //new THREE.BoxBufferGeometry(1,1,1,sts.length,1,1); - //console.log("d.zFloor=%.1f", d.zFloor); //DEBUG - let zHigh = d.zFloor; - let zLow = d.zFloor - d.thickness; - let wlHigh = hull.getWaterline(zHigh); - let wlLow = hull.getWaterline(zLow); - let pos = deckGeom.getAttribute("position"); - let pa = pos.array; - for (let j = 0; j < stss.length + 1; j++) { - //This was totally wrong, and still would benefit from - //not mapping directly to stations, as shorter decks will - //Get zero-width sections - let x = stss[j]; //d.xAft+(j/stss.length)*(d.xFwd-d.xAft); - if (isNaN(x)) x = stss[j - 1]; - x = Math.max(d.xAft, Math.min(d.xFwd, x)); - let y1 = Vessel.f.linearFromArrays(stss, wlHigh, x); - let y2 = Vessel.f.linearFromArrays(stss, wlLow, x); - let y = Math.min(0.5 * d.breadth, y1, y2); - pa[3 * j] = x; - pa[3 * j + 1] = y; - pa[3 * (stss.length + 1) + 3 * j] = x; - pa[3 * (stss.length + 1) + 3 * j + 1] = -y; //test - } - pos.needsUpdate = true; - - //DEBUG - //console.log("d.xFwd=%.1f, d.xAft=%.1f, 0.5*d.breadth=%.1f", d.xFwd, d.xAft, 0.5*d.breadth); - //console.log(pa); - let mat = deckMat; - if (d.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof d.style.color !== "undefined" ? d.style.color : 0xcccccc, - transparent: true, - opacity: - typeof d.style.opacity !== "undefined" - ? d.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - let deck = new THREE.Mesh(deckGeom, mat); - deck.name = dk; //[i]; - deck.position.z = d.zFloor; - //deck.scale.set(d.xFwd-d.xAft, d.breadth, d.thickness); - //deck.position.set(0.5*(d.xFwd+d.xAft), 0, d.zFloor); - decks.add(deck); - } - this.decks = decks; - this.cmContainer.add(decks); - - //Bulkheads: - var bulkheads = new THREE.Group(); - // Individually trimmed geometries like the decks @ferrari212 - let bhMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - let bhs = ship.structure.bulkheads; - let maxWl = Math.max(...hull.halfBreadths.waterlines) * Depth; - //let bhk = Object.keys(bhs); - //for (let i = 0; i < bhk.length; i++) { - for (let bhk in bhs) { - let bh = bhs[bhk]; //bhs[bhk[i]]; - let mat = bhMat; - let station = hull.getStation(bh.xAft); - - if (bh.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof bh.style.color !== "undefined" ? bh.style.color : 0xcccccc, - transparent: true, - opacity: - typeof bh.style.opacity !== "undefined" - ? bh.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - - let bulkheadGeom = new THREE.PlaneBufferGeometry( - maxWl, - BOA, - station.length - 1, - 1 - ); - - let pos = bulkheadGeom.getAttribute("position"); - let pa = pos.array; - - for (let i = 0; i < station.length; i++) { - // Check height in order to trim the bulkhead in the deck - if (pa[3 * i] < Depth - maxWl / 2) { - pa[3 * i + 1] = station[i]; - pa[3 * station.length + 3 * i + 1] = -station[i]; - } else { - pa[3 * i + 1] = pa[3 * station.length + 3 * i + 1] = 0; - } - } - pos.needsUpdate = true; - let bulkhead = new THREE.Mesh(bulkheadGeom, mat); - - bulkhead.name = bhk; //[i]; - - // The try verification is used to verify if the group affiliation was inserted in the JSON structure, - // the affiliation must be decided in the future if it will be incorporate into the main structure of the group - // or if there is a better approach to classify it. - // @ferrari212 - try { - bulkhead.group = bh.affiliations.group; - } catch (error) { - console.warn('Group tag were introduced to bulkhead object'); - console.warn(error); - } - - bulkhead.rotation.y = -Math.PI / 2; - bulkhead.position.set(bh.xAft, 0, maxWl / 2); - bulkheads.add(bulkhead); - } - this.bulkheads = bulkheads; - this.cmContainer.add(bulkheads); - - //Objects - - this.materials = {}; - this.stlPath = stlPath; - let stlManager = new THREE.LoadingManager(); - this.stlLoader = new THREE.STLLoader(stlManager); - /*stlManager.onLoad = function() { - createGUI(materials, deckMat); - }*/ - - this.blocks = new THREE.Group(); - this.cmContainer.add(this.blocks); - - //Default placeholder geometry - this.boxGeom = new THREE.BoxBufferGeometry(1, 1, 1); - this.boxGeom.translate(0, 0, 0.5); - - let objects = Object.values(ship.derivedObjects); - for (let i = 0; i < objects.length; i++) { - this.addObject(objects[i]); - } - - //console.log("Reached end of Ship3D constructor."); - } - Ship3D.prototype = Object.create(THREE.Group.prototype); - Object.assign(Ship3D.prototype, { - constructor: Ship3D, - addObject: function(object) { - let mat; - if ( - typeof object.style.color !== "undefined" || - typeof object.style.opacity !== "undefined" - ) { - let color = - typeof object.style.color !== "undefined" - ? object.style.color - : this.randomColor(); - let opacity = - typeof object.style.opacity !== "undefined" - ? object.style.opacity - : this.objectOpacity; - mat = new THREE.MeshPhongMaterial({ - color, - transparent: true, - opacity - }); - } else { - let name = this.stripName(object.id); - if (this.materials[name] !== undefined) { - mat = this.materials[name]; - } else { - mat = new THREE.MeshPhongMaterial({ - color: this.randomColor(), - transparent: true, - opacity: this.objectOpacity - }); - this.materials[name] = mat; - } - } - - let bo = object.baseObject; - - //Position - let s = this.ship.designState.getObjectState(object); - let x = s.xCentre; - let y = s.yCentre; - let z = s.zBase; - - //Small position jitter to avoid z-fighting - let n = 0.01 * (2 * Math.random() - 1); - x += n; - y += n; - z += n; - - //Scale - let d = bo.boxDimensions; - - if (bo.file3D) { - let self = this; - this.stlLoader.load( - this.stlPath + "/" + bo.file3D, - function onLoad(geometry) { - //Normalize: - geometry.computeBoundingBox(); - let b = geometry.boundingBox; - geometry.translate(-b.min.x, -b.min.y, -b.min.z); - geometry.scale( - 1 / (b.max.x - b.min.x), - 1 / (b.max.y - b.min.y), - 1 / (b.max.z - b.min.z) - ); - //Align with the same coordinate system as placeholder blocks: - geometry.translate(-0.5, -0.5, 0); - let m = new THREE.Mesh(geometry, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - m.name = object.id; - self.blocks.add(m); - }, - undefined, - function onError() { - console.warn( - "Error loading STL file " + - bo.file3D + - ". Falling back on placeholder." - ); - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - m.name = object.id; - this.blocks.add(m); - } - ); - } else { - //Placeholder: - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - m.name = object.id; - this.blocks.add(m); - } - }, - //this function is used as a temporary hack to group similar objects by color - stripName: function(s) { - s = s.replace(/[0-9]/g, ""); - s = s.trim(); - return s; - }, - randomColor: function() { - let r = Math.round(Math.random() * 0xff); - let g = Math.round(Math.random() * 0xff); - let b = Math.round(Math.random() * 0xff); - return (r << 16) | (g << 8) | b; - } - }); - - //Class to contain the geometry of a hull side. - //(Should perhaps be replaced by a HullGeometry class, but then - //it cannot be a simple subclass of PlaneBufferGeometry.) - //After instantiation, stations, waterlines and table can be modified or replaced, - //but the data dimensions NxM must remain the same. - function HullSideGeometry(stations, waterlines, table) { - this.stations = stations; - this.waterlines = waterlines; - this.table = table; - this.N = stations.length; - this.M = waterlines.length; - //Hull side, in principle Y offsets on an XZ plane: - //Even though a plane geometry is usually defined in terms of Z offsets on an XY plane, the order of the coordinates for each vertex is not so important. What is important is to get the topology right. This is ensured by working with the right order of the vertices. - THREE.PlaneBufferGeometry.call( - this, - undefined, - undefined, - this.N - 1, - this.M - 1 - ); - - this.update(); - } - - HullSideGeometry.prototype = Object.create( - THREE.PlaneBufferGeometry.prototype - ); - Object.assign(HullSideGeometry.prototype, { - update: function() { - let pos = this.getAttribute("position"); - let pa = pos.array; - - const N = this.N; - const M = this.M; - - //loop1: - //zs - let c = 0; - //Iterate over waterlines - for (let j = 0; j < M; j++) { - //loop2: - //xs - //iterate over stations - for (let i = 0; i < N; i++) { - //if (table[j][i] === null) continue;// loop1; - pa[c] = this.stations[i]; //x - //DEBUG, OK. No attempts to read outside of table - /*if(typeof table[j] === "undefined") console.error("table[%d] is undefined", j); - else if (typeof table[j][i] === "undefined") console.error("table[%d][%d] is undefined", j, i);*/ - //y - pa[c + 1] = this.table[j][i]; //y - pa[c + 2] = this.waterlines[j]; //z - c += 3; - } - } - //console.error("c-pa.length = %d", c-pa.length); //OK, sets all cells - - //Get rid of nulls by merging their points with the closest non-null point in the same station: - /*I am joining some uvs too. Then an applied texture will be cropped, not distorted, where the hull is cropped.*/ - let uv = this.getAttribute("uv"); - let uva = uv.array; - //Iterate over stations - for (let i = 0; i < N; i++) { - let firstNumberJ; - let lastNumberJ; - //Iterate over waterlines - let j; - for (j = 0; j < M; j++) { - let y = this.table[j][i]; - //If this condition is satisfied (number found), - //the loop will be quitted - //after the extra logic below: - if (y !== null) { - firstNumberJ = j; - lastNumberJ = j; - //copy vector for i,j to positions for all null cells below: - let c = firstNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (firstNumberJ > 0) { - firstNumberJ--; - d -= N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - break; - } - //console.log("null encountered."); - } - - //Continue up the hull (with same j counter), searching for upper number. This does not account for the existence of numbers above the first null encountered. - for (; j < M; j++) { - let y = this.table[j][i]; - if (y === null) { - //console.log("null encountered."); - break; - } - //else not null: - lastNumberJ = j; - } - - //copy vector for i,j to positions for all null cells above: - let c = lastNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (lastNumberJ < M - 1) { - lastNumberJ++; - d += N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - ////////// - } - - //console.log(pa); - - pos.needsUpdate = true; - uv.needsUpdate = true; - this.computeVertexNormals(); - } - }); - - function Hull3D(hull, design_draft) { - THREE.Group.call(this); - - this.hull = hull; - this.design_draft = - design_draft !== undefined ? design_draft : 0.5 * hull.attributes.Depth; - this.upperColor = - typeof hull.style.upperColor !== "undefined" - ? hull.style.upperColor - : 0x33aa33; - this.lowerColor = - typeof hull.style.lowerColor !== "undefined" - ? hull.style.lowerColor - : 0xaa3333; - this.opacity = - typeof hull.style.opacity !== "undefined" ? hull.style.opacity : 0.5; - - this.update(); - } - Hull3D.prototype = Object.create(THREE.Group.prototype); - - Object.assign(Hull3D.prototype, { - //Experimental addition. Broken. - addStation: function(p) { - const hb = this.hull.halfBreadths; - const { index, mu } = Vessel.f.bisectionSearch(hb.stations, p); - hb.stations.splice(index, 0, p); - for (let i = 0; i < hb.waterlines.length; i++) { - hb.table[i].splice(index, 0, 0); - } - - this.update(); - }, - //Experimental addition - addWaterline: function(p) { - const hb = this.hull.halfBreadths; - const { index, mu } = Vessel.f.bisectionSearch(hb.waterlines, p); - hb.waterlines.splice(index, 0, p); - hb.table.splice(index, 0, new Array(hb.stations.length).fill(0)); - - this.update(); - }, - //or updateGeometries? - update: function() { - const hull = this.hull; - const upperColor = this.upperColor; - const lowerColor = this.lowerColor; - const design_draft = this.design_draft; - const opacity = this.opacity; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //None of these are changed during correction of the geometry. - let stations = hull.halfBreadths.stations; - let waterlines = hull.halfBreadths.waterlines; - let table = hull.halfBreadths.table; - - if (this.hGeom) this.hGeom.dispose(); - this.hGeom = new HullSideGeometry(stations, waterlines, table); - - let N = stations.length; - let M = waterlines.length; - - //Bow cap: - let bowPlaneOffsets = hull.getStation(LOA).map(str => str / (0.5 * BOA)); //normalized - if (this.bowCapG) this.bowCapG.dispose(); - this.bowCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - 1, - M - 1 - ); - let pos = this.bowCapG.getAttribute("position"); - let pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 1; - pa[3 * (2 * j) + 1] = bowPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 1; - pa[3 * (2 * j + 1) + 1] = -bowPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Aft cap: - let aftPlaneOffsets = hull.getStation(0).map(str => str / (0.5 * BOA)); //normalized - if (this.aftCapG) this.aftCapG.dispose(); - this.aftCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - 1, - M - 1 - ); - pos = this.aftCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 0; - pa[3 * (2 * j) + 1] = -aftPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 0; - pa[3 * (2 * j + 1) + 1] = aftPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Bottom cap: - let bottomPlaneOffsets = hull.getWaterline(0).map(hw => hw / (0.5 * BOA)); //normalized - if (this.bottomCapG) this.bottomCapG.dispose(); - this.bottomCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - 1 - ); - pos = this.bottomCapG.getAttribute("position"); - pa = pos.array; - //constant z-offset xy plane - for (let i = 0; i < N; i++) { - pa[3 * i] = stations[i]; - pa[3 * i + 1] = -bottomPlaneOffsets[i]; - pa[3 * i + 2] = 0; - pa[3 * (N + i)] = stations[i]; - pa[3 * (N + i) + 1] = bottomPlaneOffsets[i]; - pa[3 * (N + i) + 2] = 0; - } - pos.needsUpdate = true; - - //Hull material - if (!this.hMat) { - let phong = THREE.ShaderLib.phong; - let commonDecl = - "uniform float wlThreshold;uniform vec3 aboveWL; uniform vec3 belowWL;\nvarying float vZ;"; - this.hMat = new THREE.ShaderMaterial({ - uniforms: THREE.UniformsUtils.merge([ - phong.uniforms, - { - wlThreshold: new THREE.Uniform(0.5), - aboveWL: new THREE.Uniform(new THREE.Color()), - belowWL: new THREE.Uniform(new THREE.Color()) - } - ]), - vertexShader: - commonDecl + - phong.vertexShader - .replace("main() {", "main() {\nvZ = position.z;") - .replace("#define PHONG", ""), - fragmentShader: - commonDecl + - phong.fragmentShader - .replace( - "vec4 diffuseColor = vec4( diffuse, opacity );", - "vec4 diffuseColor = vec4( (vZ>wlThreshold)? aboveWL.rgb : belowWL.rgb, opacity );" - ) - .replace("#define PHONG", ""), - side: THREE.DoubleSide, - lights: true, - transparent: true - }); - } - this.hMat.uniforms.wlThreshold.value = this.design_draft / Depth; - this.hMat.uniforms.aboveWL.value = new THREE.Color(upperColor); - this.hMat.uniforms.belowWL.value = new THREE.Color(lowerColor); - this.hMat.uniforms.opacity.value = opacity; - - if (this.port) this.remove(this.port); - this.port = new THREE.Mesh(this.hGeom, this.hMat); - if (this.starboard) this.remove(this.starboard); - this.starboard = new THREE.Mesh(this.hGeom, this.hMat); - this.starboard.scale.y = -1; - this.add(this.port, this.starboard); - - //Caps: - if (this.bowCap) this.remove(this.bowCap); - this.bowCap = new THREE.Mesh(this.bowCapG, this.hMat); - if (this.aftCap) this.remove(this.aftCap); - this.aftCap = new THREE.Mesh(this.aftCapG, this.hMat); - if (this.bottomCap) this.remove(this.bottomCap); - this.bottomCap = new THREE.Mesh(this.bottomCapG, this.hMat); - - this.add(this.bowCap, this.aftCap, this.bottomCap); - - this.scale.set(LOA, 0.5 * BOA, Depth); - } - }); - - return Ship3D; -} - - -function _21(md){return( -md`### Libraries` -)} - -function _Vessel(require){return( -require('ntnu-vessel@0.1.1/vessel.js').catch(() => window["Vessel"]) -)} - -async function _THREE(require) -{ - const THREE = window.THREE = await require("three@0.99.0/build/three.min.js"); - await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {}); - await require("three@0.99.0/examples/js/loaders/STLLoader.js").catch(() => {}); - return THREE; -} - - -function _d3(require){return( -require("d3@5") -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - main.variable(observer()).define(["md"], _1); - main.variable(observer("Gunnerus")).define("Gunnerus", _Gunnerus); - main.variable(observer()).define(["md"], _3); - main.variable(observer()).define(["Gunnerus"], _4); - main.variable(observer("ship")).define("ship", ["Vessel","Gunnerus"], _ship); - main.variable(observer()).define(["md"], _6); - main.variable(observer("ship3D")).define("ship3D", ["Ship3D","ship"], _ship3D); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D"], _8); - main.variable(observer()).define(["md"], _9); - main.variable(observer("Gunnerus2")).define("Gunnerus2", _Gunnerus2); - main.variable(observer("ship2")).define("ship2", ["Vessel","Gunnerus2"], _ship2); - main.variable(observer("ship3D2")).define("ship3D2", ["Ship3D","ship2"], _ship3D2); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D2"], _13); - main.variable(observer()).define(["md"], _14); - main.variable(observer()).define(["Gunnerus2"], _15); - main.variable(observer()).define(["md"], _16); - main.variable(observer()).define(["md"], _17); - main.variable(observer()).define(["md"], _18); - main.variable(observer()).define(["md"], _19); - main.variable(observer("Ship3D")).define("Ship3D", ["THREE","Vessel"], _Ship3D); - main.variable(observer()).define(["md"], _21); - main.variable(observer("Vessel")).define("Vessel", ["require"], _Vessel); - main.variable(observer("THREE")).define("THREE", ["require"], _THREE); - main.variable(observer("d3")).define("d3", ["require"], _d3); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/index.html b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/index.html deleted file mode 100644 index 17f2e5c..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Section 2.4 - Equipments and STL elements - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/index.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/index.js deleted file mode 100644 index 1d98936..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./b6441b3891937553@193.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/package.json b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/package.json deleted file mode 100644 index 1958d65..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/section-2-4-equipments-and-stl-elements", - "main": "b6441b3891937553@193.js", - "version": "193.0.0", - "homepage": "https://observablehq.com/@ferrari212/section-2-4-equipments-and-stl-elements", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-4/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/LICENSE.txt b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/LICENSE.txt deleted file mode 100644 index e391c95..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/LICENSE.txt +++ /dev/null @@ -1,429 +0,0 @@ -Copyright 2021 Felipe Ferrari - -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the “Licensor.” The text of the Creative Commons public -licenses is dedicated to the public domain under the CC0 Public Domain -Dedication. Except for the limited purpose of indicating that material -is shared under a Creative Commons public license or as otherwise -permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/README.md b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/README.md deleted file mode 100644 index f582018..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Section 2.5 - Importing External Elements - -https://observablehq.com/@ferrari212/section-2-5-final-consideration@80 - -View this notebook in your browser by running a web server in this folder. For -example: - -~~~sh -npx http-server -~~~ - -Or, use the [Observable Runtime](https://github.com/observablehq/runtime) to -import this module directly into your application. To npm install: - -~~~sh -npm install @observablehq/runtime@5 -npm install https://api.observablehq.com/d/fb258c96437db831@80.tgz?v=3 -~~~ - -Then, import your notebook and the runtime as: - -~~~js -import {Runtime, Inspector} from "@observablehq/runtime"; -import define from "@ferrari212/section-2-5-final-consideration"; -~~~ - -To log the value of the cell named “foo”: - -~~~js -const runtime = new Runtime(); -const main = runtime.module(define); -main.value("foo").then(value => console.log(value)); -~~~ diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/fb258c96437db831@80.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/fb258c96437db831@80.js deleted file mode 100644 index 95f9c7b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/fb258c96437db831@80.js +++ /dev/null @@ -1,887 +0,0 @@ -// https://observablehq.com/@ferrari212/section-2-5-final-consideration@80 -function _1(md){return( -md` -# Section 2.5 - Importing External Elements - -This section marks the milestone aimed to introduce how the compartments, tanks and equipment can be described using the library vessel.js, giving as result the Gunnerus 3D virtual representation. The Gunnerus JSON description can be imported remotely using D3: -` -)} - -function _Gunnerus(FileAttachment){return( -FileAttachment("gunnerus.json").json() -)} - -function _3(md){return( -md` -The JSON element can be used as explained in the previous sections: -` -)} - -function _ship(Vessel,Gunnerus){return( -new Vessel.Ship(Gunnerus) -)} - -function _ship3D(Ship3D,ship){return( -new Ship3D(ship, { - shipState: ship.designState.clone(), - stlPath: "https://shiplab.github.io/vesseljs/examples/specs/STL%20files/Gunnerus", - upperColor: 0x33aa33, - lowerColor: 0xaa3333, - hullOpacity: 0.5, - deckOpacity: 0.5, - objectOpacity: 0.5 - }) -)} - -function* _6(THREE,width,ship,invalidation,ship3D) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - - const scene = new THREE.Scene(); - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50, aspect); - camera.up.set(0, 0, 1); - scene.add(camera); - const LOA = ship.structure.hull.attributes.LOA; - camera.position.set(0.3 * LOA, 0.7 * LOA, 0.7 * LOA); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(0, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - scene.add(ship3D); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _7(md){return( -md ` - [<< Previous](../section-2-4/index.html) || Top || [Next >>](../section-2-6/index.html?collection=@ferrari212/from-hull-to-simulation) -` -)} - -function _8(md){return( -md`### References` -)} - -function _9(md){return( -md ` -**[1] Structure Definition ** – -Icaro Fonseca [/@icarofonseca/hull-definition-and-hydrostatics](https://observablehq.com/@icarofonseca/hull-definition-and-hydrostatics) - -**[2] Object Visualization ** – -Icaro Fonseca [/@icarofonseca/object-visualization](https://observablehq.com/@icarofonseca/object-visualization) -` -)} - -function _10(md){return( -md`### Snippets` -)} - -function _Ship3D(THREE,Vessel) -{ - //@EliasHasle - - /* -Draft for new version. More modularized, and interacts with a ship state. -Uses an additional coordinate system for motions. -The position.xy and rotation.z of the Ship3D object plae the ship in the 3D world. -(Not geographically) -position.z is the (negative) draft. -fluctCont is a "fluctuations container" to be used for dynamically -changing motions like heave, pitch, roll. -cmContainer centers the motion on the center of gravity. -normalizer nulls out the center of gravity height before the draft is applied. - - -THREE.js Object3D constructed from Vessel.js Ship object. - -There are some serious limitations to this: -1. null values encountered are assumed to be either at the top or bottom of the given station. -2. The end caps and bulkheads are sometimes corrected with zeros where they should perhaps have been clipped because of null values. - -TODO: Use calculated draft for position.z, and place the ship model in a motion container centered at the calculated metacenter. -*/ - - //var hMat; //global for debugging - - function Ship3D( - ship, - { shipState, stlPath, deckOpacity = 0.2, objectOpacity = 0.5 } - ) { - THREE.Group.call(this); - - this.normalizer = new THREE.Group(); - this.fluctCont = new THREE.Group(); - this.fluctCont.rotation.order = "ZYX"; //right? - this.cmContainer = new THREE.Group(); - this.fluctCont.add(this.cmContainer); - this.normalizer.add(this.fluctCont); - this.add(this.normalizer); - - Object.defineProperty(this, "draft", { - get: function() { - return -this.position.z; - } /*, - set: function(value) { - this.position.z = -value; - }*/ - }); - Object.defineProperty(this, "surge", { - get: function() { - return this.fluctCont.position.x; - }, - set: function(value) { - this.fluctCont.position.x = value; - //this.shipState.motion.surge = value; - } - }); - Object.defineProperty(this, "sway", { - get: function() { - return this.fluctCont.position.y; - }, - set: function(value) { - this.fluctCont.position.y = value; - //this.shipState.motion.sway = value; - } - }); - Object.defineProperty(this, "heave", { - get: function() { - return this.fluctCont.position.z; - }, - set: function(value) { - this.fluctCont.position.z = value; - //this.shipState.motion.heave = value; - } - }); - Object.defineProperty(this, "yaw", { - get: function() { - return this.fluctCont.rotation.z; - }, - set: function(value) { - this.fluctCont.rotation.z = value; - //this.shipState.motion.yaw = value; - } - }); - Object.defineProperty(this, "pitch", { - get: function() { - return this.fluctCont.rotation.y; - }, - set: function(value) { - this.fluctCont.rotation.y = value; - //this.shipState.motion.pitch = value; - } - }); - Object.defineProperty(this, "roll", { - get: function() { - return this.fluctCont.rotation.x; - }, - set: function(value) { - this.fluctCont.rotation.x = value; - //this.shipState.motion.roll = value; - } - }); - - this.objectOpacity = objectOpacity; - - this.ship = ship; - this.shipState = shipState || ship.designState.clone(); - - let hull = ship.structure.hull; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //console.log("LOA:%.1f, BOA:%.1f, Depth:%.1f",LOA,BOA,Depth); - let { - w: { cg, mass }, - T, - GMt, - GMl - } = ship.calculateStability(this.shipState); - - this.cmContainer.position.set(-cg.x, -cg.y, -cg.z); - this.normalizer.position.z = cg.z; - this.position.z = -T; - - let designDraft = ship.designState.calculationParameters.Draft_design; - this.hull3D = new Hull3D(hull, designDraft); - this.cmContainer.add(this.hull3D); - - //DEBUG, to show only hull: - //return; - - let stations = hull.halfBreadths.stations; - //Decks: - var decks = new THREE.Group(); - let deckMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - //deckGeom.translate(0,0,-0.5); - let ds = ship.structure.decks; - //let dk = Object.keys(ds); - let stss = stations.map(st => LOA * st); //use scaled stations for now - //console.log(dk); - //for (let i = 0; i < dk.length; i++) { - for (let dk in ds) { - //let d = ds[dk[i]]; //deck in ship structure - let d = ds[dk]; - - //Will eventually use BoxBufferGeometry, but that is harder, because vertices are duplicated in the face planes. - let deckGeom = new THREE.PlaneBufferGeometry(1, 1, stss.length, 1); //new THREE.BoxBufferGeometry(1,1,1,sts.length,1,1); - //console.log("d.zFloor=%.1f", d.zFloor); //DEBUG - let zHigh = d.zFloor; - let zLow = d.zFloor - d.thickness; - let wlHigh = hull.getWaterline(zHigh); - let wlLow = hull.getWaterline(zLow); - let pos = deckGeom.getAttribute("position"); - let pa = pos.array; - for (let j = 0; j < stss.length + 1; j++) { - //This was totally wrong, and still would benefit from - //not mapping directly to stations, as shorter decks will - //Get zero-width sections - let x = stss[j]; //d.xAft+(j/stss.length)*(d.xFwd-d.xAft); - if (isNaN(x)) x = stss[j - 1]; - x = Math.max(d.xAft, Math.min(d.xFwd, x)); - let y1 = Vessel.f.linearFromArrays(stss, wlHigh, x); - let y2 = Vessel.f.linearFromArrays(stss, wlLow, x); - let y = Math.min(0.5 * d.breadth, y1, y2); - pa[3 * j] = x; - pa[3 * j + 1] = y; - pa[3 * (stss.length + 1) + 3 * j] = x; - pa[3 * (stss.length + 1) + 3 * j + 1] = -y; //test - } - pos.needsUpdate = true; - - //DEBUG - //console.log("d.xFwd=%.1f, d.xAft=%.1f, 0.5*d.breadth=%.1f", d.xFwd, d.xAft, 0.5*d.breadth); - //console.log(pa); - let mat = deckMat; - if (d.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof d.style.color !== "undefined" ? d.style.color : 0xcccccc, - transparent: true, - opacity: - typeof d.style.opacity !== "undefined" - ? d.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - let deck = new THREE.Mesh(deckGeom, mat); - deck.name = dk; //[i]; - deck.position.z = d.zFloor; - //deck.scale.set(d.xFwd-d.xAft, d.breadth, d.thickness); - //deck.position.set(0.5*(d.xFwd+d.xAft), 0, d.zFloor); - decks.add(deck); - } - this.decks = decks; - this.cmContainer.add(decks); - - //Bulkheads: - var bulkheads = new THREE.Group(); - // Individually trimmed geometries like the decks @ferrari212 - let bhMat = new THREE.MeshPhongMaterial({ - color: 0xcccccc /*this.randomColor()*/, - transparent: true, - opacity: deckOpacity, - side: THREE.DoubleSide - }); - let bhs = ship.structure.bulkheads; - let maxWl = Math.max(...hull.halfBreadths.waterlines) * Depth; - //let bhk = Object.keys(bhs); - //for (let i = 0; i < bhk.length; i++) { - for (let bhk in bhs) { - let bh = bhs[bhk]; //bhs[bhk[i]]; - let mat = bhMat; - let station = hull.getStation(bh.xAft); - - if (bh.style) { - mat = new THREE.MeshPhongMaterial({ - color: - typeof bh.style.color !== "undefined" ? bh.style.color : 0xcccccc, - transparent: true, - opacity: - typeof bh.style.opacity !== "undefined" - ? bh.style.opacity - : deckOpacity, - side: THREE.DoubleSide - }); - } - - let bulkheadGeom = new THREE.PlaneBufferGeometry( - maxWl, - BOA, - station.length - 1, - 1 - ); - - let pos = bulkheadGeom.getAttribute("position"); - let pa = pos.array; - - for (let i = 0; i < station.length; i++) { - // Check height in order to trim the bulkhead in the deck - if (pa[3 * i] < Depth - maxWl / 2) { - pa[3 * i + 1] = station[i]; - pa[3 * station.length + 3 * i + 1] = -station[i]; - } else { - pa[3 * i + 1] = pa[3 * station.length + 3 * i + 1] = 0; - } - } - pos.needsUpdate = true; - let bulkhead = new THREE.Mesh(bulkheadGeom, mat); - - bulkhead.name = bhk; //[i]; - - // The try verification is used to verify if the group affiliation was inserted in the JSON structure, - // the affiliation must be decided in the future if it will be incorporate into the main structure of the group - // or if there is a better approach to classify it. - // @ferrari212 - try { - bulkhead.group = bh.affiliations.group; - } catch (error) { - console.warn('Group tag were introduced to bulkhead object'); - console.warn(error); - } - - bulkhead.rotation.y = -Math.PI / 2; - bulkhead.position.set(bh.xAft, 0, maxWl / 2); - bulkheads.add(bulkhead); - } - this.bulkheads = bulkheads; - this.cmContainer.add(bulkheads); - - //Objects - - this.materials = {}; - this.stlPath = stlPath; - let stlManager = new THREE.LoadingManager(); - this.stlLoader = new THREE.STLLoader(stlManager); - /*stlManager.onLoad = function() { - createGUI(materials, deckMat); - }*/ - - this.blocks = new THREE.Group(); - this.cmContainer.add(this.blocks); - - //Default placeholder geometry - this.boxGeom = new THREE.BoxBufferGeometry(1, 1, 1); - this.boxGeom.translate(0, 0, 0.5); - - let objects = Object.values(ship.derivedObjects); - for (let i = 0; i < objects.length; i++) { - this.addObject(objects[i]); - } - - //console.log("Reached end of Ship3D constructor."); - } - Ship3D.prototype = Object.create(THREE.Group.prototype); - Object.assign(Ship3D.prototype, { - constructor: Ship3D, - addObject: function(object) { - let mat; - if ( - typeof object.style.color !== "undefined" || - typeof object.style.opacity !== "undefined" - ) { - let color = - typeof object.style.color !== "undefined" - ? object.style.color - : this.randomColor(); - let opacity = - typeof object.style.opacity !== "undefined" - ? object.style.opacity - : this.objectOpacity; - mat = new THREE.MeshPhongMaterial({ - color, - transparent: true, - opacity - }); - } else { - let name = this.stripName(object.id); - if (this.materials[name] !== undefined) { - mat = this.materials[name]; - } else { - mat = new THREE.MeshPhongMaterial({ - color: this.randomColor(), - transparent: true, - opacity: this.objectOpacity - }); - this.materials[name] = mat; - } - } - - let bo = object.baseObject; - - //Position - let s = this.ship.designState.getObjectState(object); - let x = s.xCentre; - let y = s.yCentre; - let z = s.zBase; - - //Small position jitter to avoid z-fighting - let n = 0.01 * (2 * Math.random() - 1); - x += n; - y += n; - z += n; - - //Scale - let d = bo.boxDimensions; - - if (bo.file3D) { - let self = this; - this.stlLoader.load( - this.stlPath + "/" + bo.file3D, - function onLoad(geometry) { - //Normalize: - geometry.computeBoundingBox(); - let b = geometry.boundingBox; - geometry.translate(-b.min.x, -b.min.y, -b.min.z); - geometry.scale( - 1 / (b.max.x - b.min.x), - 1 / (b.max.y - b.min.y), - 1 / (b.max.z - b.min.z) - ); - //Align with the same coordinate system as placeholder blocks: - geometry.translate(-0.5, -0.5, 0); - let m = new THREE.Mesh(geometry, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - m.name = object.id; - self.blocks.add(m); - }, - undefined, - function onError() { - console.warn( - "Error loading STL file " + - bo.file3D + - ". Falling back on placeholder." - ); - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - m.name = object.id; - this.blocks.add(m); - } - ); - } else { - //Placeholder: - let m = new THREE.Mesh(this.boxGeom, mat); - m.position.set(x, y, z); - m.scale.set(d.length, d.breadth, d.height); - m.name = object.id; - this.blocks.add(m); - } - }, - //this function is used as a temporary hack to group similar objects by color - stripName: function(s) { - s = s.replace(/[0-9]/g, ""); - s = s.trim(); - return s; - }, - randomColor: function() { - let r = Math.round(Math.random() * 0xff); - let g = Math.round(Math.random() * 0xff); - let b = Math.round(Math.random() * 0xff); - return (r << 16) | (g << 8) | b; - } - }); - - //Class to contain the geometry of a hull side. - //(Should perhaps be replaced by a HullGeometry class, but then - //it cannot be a simple subclass of PlaneBufferGeometry.) - //After instantiation, stations, waterlines and table can be modified or replaced, - //but the data dimensions NxM must remain the same. - function HullSideGeometry(stations, waterlines, table) { - this.stations = stations; - this.waterlines = waterlines; - this.table = table; - this.N = stations.length; - this.M = waterlines.length; - //Hull side, in principle Y offsets on an XZ plane: - //Even though a plane geometry is usually defined in terms of Z offsets on an XY plane, the order of the coordinates for each vertex is not so important. What is important is to get the topology right. This is ensured by working with the right order of the vertices. - THREE.PlaneBufferGeometry.call( - this, - undefined, - undefined, - this.N - 1, - this.M - 1 - ); - - this.update(); - } - - HullSideGeometry.prototype = Object.create( - THREE.PlaneBufferGeometry.prototype - ); - Object.assign(HullSideGeometry.prototype, { - update: function() { - let pos = this.getAttribute("position"); - let pa = pos.array; - - const N = this.N; - const M = this.M; - - //loop1: - //zs - let c = 0; - //Iterate over waterlines - for (let j = 0; j < M; j++) { - //loop2: - //xs - //iterate over stations - for (let i = 0; i < N; i++) { - //if (table[j][i] === null) continue;// loop1; - pa[c] = this.stations[i]; //x - //DEBUG, OK. No attempts to read outside of table - /*if(typeof table[j] === "undefined") console.error("table[%d] is undefined", j); - else if (typeof table[j][i] === "undefined") console.error("table[%d][%d] is undefined", j, i);*/ - //y - pa[c + 1] = this.table[j][i]; //y - pa[c + 2] = this.waterlines[j]; //z - c += 3; - } - } - //console.error("c-pa.length = %d", c-pa.length); //OK, sets all cells - - //Get rid of nulls by merging their points with the closest non-null point in the same station: - /*I am joining some uvs too. Then an applied texture will be cropped, not distorted, where the hull is cropped.*/ - let uv = this.getAttribute("uv"); - let uva = uv.array; - //Iterate over stations - for (let i = 0; i < N; i++) { - let firstNumberJ; - let lastNumberJ; - //Iterate over waterlines - let j; - for (j = 0; j < M; j++) { - let y = this.table[j][i]; - //If this condition is satisfied (number found), - //the loop will be quitted - //after the extra logic below: - if (y !== null) { - firstNumberJ = j; - lastNumberJ = j; - //copy vector for i,j to positions for all null cells below: - let c = firstNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (firstNumberJ > 0) { - firstNumberJ--; - d -= N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - break; - } - //console.log("null encountered."); - } - - //Continue up the hull (with same j counter), searching for upper number. This does not account for the existence of numbers above the first null encountered. - for (; j < M; j++) { - let y = this.table[j][i]; - if (y === null) { - //console.log("null encountered."); - break; - } - //else not null: - lastNumberJ = j; - } - - //copy vector for i,j to positions for all null cells above: - let c = lastNumberJ * N + i; - let x = pa[3 * c]; - let y = pa[3 * c + 1]; - let z = pa[3 * c + 2]; - let d = c; - while (lastNumberJ < M - 1) { - lastNumberJ++; - d += N; - pa[3 * d] = x; - pa[3 * d + 1] = y; - pa[3 * d + 2] = z; - uva[2 * d] = uva[2 * c]; - uva[2 * d + 1] = uva[2 * c + 1]; - } - ////////// - } - - //console.log(pa); - - pos.needsUpdate = true; - uv.needsUpdate = true; - this.computeVertexNormals(); - } - }); - - function Hull3D(hull, design_draft) { - THREE.Group.call(this); - - this.hull = hull; - this.design_draft = - design_draft !== undefined ? design_draft : 0.5 * hull.attributes.Depth; - this.upperColor = - typeof hull.style.upperColor !== "undefined" - ? hull.style.upperColor - : 0x33aa33; - this.lowerColor = - typeof hull.style.lowerColor !== "undefined" - ? hull.style.lowerColor - : 0xaa3333; - this.opacity = - typeof hull.style.opacity !== "undefined" ? hull.style.opacity : 0.5; - - this.update(); - } - Hull3D.prototype = Object.create(THREE.Group.prototype); - - Object.assign(Hull3D.prototype, { - //Experimental addition. Broken. - addStation: function(p) { - const hb = this.hull.halfBreadths; - const { index, mu } = Vessel.f.bisectionSearch(hb.stations, p); - hb.stations.splice(index, 0, p); - for (let i = 0; i < hb.waterlines.length; i++) { - hb.table[i].splice(index, 0, 0); - } - - this.update(); - }, - //Experimental addition - addWaterline: function(p) { - const hb = this.hull.halfBreadths; - const { index, mu } = Vessel.f.bisectionSearch(hb.waterlines, p); - hb.waterlines.splice(index, 0, p); - hb.table.splice(index, 0, new Array(hb.stations.length).fill(0)); - - this.update(); - }, - //or updateGeometries? - update: function() { - const hull = this.hull; - const upperColor = this.upperColor; - const lowerColor = this.lowerColor; - const design_draft = this.design_draft; - const opacity = this.opacity; - - let LOA = hull.attributes.LOA; - let BOA = hull.attributes.BOA; - let Depth = hull.attributes.Depth; - - //None of these are changed during correction of the geometry. - let stations = hull.halfBreadths.stations; - let waterlines = hull.halfBreadths.waterlines; - let table = hull.halfBreadths.table; - - if (this.hGeom) this.hGeom.dispose(); - this.hGeom = new HullSideGeometry(stations, waterlines, table); - - let N = stations.length; - let M = waterlines.length; - - //Bow cap: - let bowPlaneOffsets = hull.getStation(LOA).map(str => str / (0.5 * BOA)); //normalized - if (this.bowCapG) this.bowCapG.dispose(); - this.bowCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - 1, - M - 1 - ); - let pos = this.bowCapG.getAttribute("position"); - let pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 1; - pa[3 * (2 * j) + 1] = bowPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 1; - pa[3 * (2 * j + 1) + 1] = -bowPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Aft cap: - let aftPlaneOffsets = hull.getStation(0).map(str => str / (0.5 * BOA)); //normalized - if (this.aftCapG) this.aftCapG.dispose(); - this.aftCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - 1, - M - 1 - ); - pos = this.aftCapG.getAttribute("position"); - pa = pos.array; - //constant x-offset yz plane - for (let j = 0; j < M; j++) { - pa[3 * (2 * j)] = 0; - pa[3 * (2 * j) + 1] = -aftPlaneOffsets[j]; - pa[3 * (2 * j) + 2] = waterlines[j]; - pa[3 * (2 * j + 1)] = 0; - pa[3 * (2 * j + 1) + 1] = aftPlaneOffsets[j]; - pa[3 * (2 * j + 1) + 2] = waterlines[j]; - } - pos.needsUpdate = true; - - //Bottom cap: - let bottomPlaneOffsets = hull.getWaterline(0).map(hw => hw / (0.5 * BOA)); //normalized - if (this.bottomCapG) this.bottomCapG.dispose(); - this.bottomCapG = new THREE.PlaneBufferGeometry( - undefined, - undefined, - N - 1, - 1 - ); - pos = this.bottomCapG.getAttribute("position"); - pa = pos.array; - //constant z-offset xy plane - for (let i = 0; i < N; i++) { - pa[3 * i] = stations[i]; - pa[3 * i + 1] = -bottomPlaneOffsets[i]; - pa[3 * i + 2] = 0; - pa[3 * (N + i)] = stations[i]; - pa[3 * (N + i) + 1] = bottomPlaneOffsets[i]; - pa[3 * (N + i) + 2] = 0; - } - pos.needsUpdate = true; - - //Hull material - if (!this.hMat) { - let phong = THREE.ShaderLib.phong; - let commonDecl = - "uniform float wlThreshold;uniform vec3 aboveWL; uniform vec3 belowWL;\nvarying float vZ;"; - this.hMat = new THREE.ShaderMaterial({ - uniforms: THREE.UniformsUtils.merge([ - phong.uniforms, - { - wlThreshold: new THREE.Uniform(0.5), - aboveWL: new THREE.Uniform(new THREE.Color()), - belowWL: new THREE.Uniform(new THREE.Color()) - } - ]), - vertexShader: - commonDecl + - phong.vertexShader - .replace("main() {", "main() {\nvZ = position.z;") - .replace("#define PHONG", ""), - fragmentShader: - commonDecl + - phong.fragmentShader - .replace( - "vec4 diffuseColor = vec4( diffuse, opacity );", - "vec4 diffuseColor = vec4( (vZ>wlThreshold)? aboveWL.rgb : belowWL.rgb, opacity );" - ) - .replace("#define PHONG", ""), - side: THREE.DoubleSide, - lights: true, - transparent: true - }); - } - this.hMat.uniforms.wlThreshold.value = this.design_draft / Depth; - this.hMat.uniforms.aboveWL.value = new THREE.Color(upperColor); - this.hMat.uniforms.belowWL.value = new THREE.Color(lowerColor); - this.hMat.uniforms.opacity.value = opacity; - - if (this.port) this.remove(this.port); - this.port = new THREE.Mesh(this.hGeom, this.hMat); - if (this.starboard) this.remove(this.starboard); - this.starboard = new THREE.Mesh(this.hGeom, this.hMat); - this.starboard.scale.y = -1; - this.add(this.port, this.starboard); - - //Caps: - if (this.bowCap) this.remove(this.bowCap); - this.bowCap = new THREE.Mesh(this.bowCapG, this.hMat); - if (this.aftCap) this.remove(this.aftCap); - this.aftCap = new THREE.Mesh(this.aftCapG, this.hMat); - if (this.bottomCap) this.remove(this.bottomCap); - this.bottomCap = new THREE.Mesh(this.bottomCapG, this.hMat); - - this.add(this.bowCap, this.aftCap, this.bottomCap); - - this.scale.set(LOA, 0.5 * BOA, Depth); - } - }); - - return Ship3D; -} - - -function _12(md){return( -md`### Libraries` -)} - -function _Vessel(require){return( -require('ntnu-vessel@0.1.1/vessel.js').catch(() => window["Vessel"]) -)} - -async function _THREE(require) -{ - const THREE = window.THREE = await require("three@0.99.0/build/three.min.js"); - await require("three@0.99.0/examples/js/controls/OrbitControls.js").catch(() => {}); - await require("three@0.99.0/examples/js/loaders/STLLoader.js").catch(() => {}); - return THREE; -} - - -function _d3(require){return( -require("d3@5") -)} - -export default function define(runtime, observer) { - const main = runtime.module(); - function toString() { return this.url; } - const fileAttachments = new Map([ - ["gunnerus.json", {url: new URL("../section-2-5/files/jason_one.json", import.meta.url), mimeType: "application/json", toString}] - ]); - main.builtin("FileAttachment", runtime.fileAttachments(name => fileAttachments.get(name))); - main.variable(observer()).define(["md"], _1); - main.variable(observer("Gunnerus")).define("Gunnerus", ["FileAttachment"], _Gunnerus); - main.variable(observer()).define(["md"], _3); - main.variable(observer("ship")).define("ship", ["Vessel","Gunnerus"], _ship); - main.variable(observer("ship3D")).define("ship3D", ["Ship3D","ship"], _ship3D); - main.variable(observer()).define(["THREE","width","ship","invalidation","ship3D"], _6); - main.variable(observer()).define(["md"], _7); - main.variable(observer()).define(["md"], _8); - main.variable(observer()).define(["md"], _9); - main.variable(observer()).define(["md"], _10); - main.variable(observer("Ship3D")).define("Ship3D", ["THREE","Vessel"], _Ship3D); - main.variable(observer()).define(["md"], _12); - main.variable(observer("Vessel")).define("Vessel", ["require"], _Vessel); - main.variable(observer("THREE")).define("THREE", ["require"], _THREE); - main.variable(observer("d3")).define("d3", ["require"], _d3); - return main; -} diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/files/jason_one.json b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/files/jason_one.json deleted file mode 100644 index 0d6c166..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/files/jason_one.json +++ /dev/null @@ -1,4133 +0,0 @@ -{ - "attributes": {}, - "designState": { - "calculationParameters": { - "LWL_design": 34.9, - "Draft_design": 2.787, - "Cb_design": 0.626, - "speed": "", - "crew": "", - "K": "", - "Co": "", - "tripDuration": "" - }, - "objectOverrides": { - "common": { - "fullness": "" - } - } - }, - "data": {}, - "structure": { - "hull": { - "attributes": { - "LOA": 36.25, - "BOA": 9.6, - "Depth": 6.6, - "APP": 2, - "bulb": true, - "transom": true, - "cstern": 0, - "prismaticLengthRatio": 0.6, - "appendices": {} - }, - "halfBreadths": { - "waterlines": [ - 0, - 0.075757576, - 0.151515152, - 0.227272727, - 0.303030303, - 0.378787879, - 0.454545455, - 0.53030303, - 0.606060606, - 0.681818182, - 0.757575758, - 0.833333333, - 0.909090909, - 0.984848485, - 1.060606061, - 1.136363636 - ], - "stations": [ - 0, - 0.016, - 0.032, - 0.048, - 0.064, - 0.08, - 0.096, - 0.112, - 0.128, - 0.144, - 0.16, - 0.176, - 0.192, - 0.208, - 0.224, - 0.24, - 0.256, - 0.272, - 0.288, - 0.304, - 0.32, - 0.336, - 0.352, - 0.368, - 0.384, - 0.4, - 0.416, - 0.432, - 0.448, - 0.464, - 0.48, - 0.496, - 0.512, - 0.528, - 0.544, - 0.56, - 0.576, - 0.592, - 0.608, - 0.624, - 0.64, - 0.656, - 0.672, - 0.688, - 0.704, - 0.72, - 0.736, - 0.752, - 0.768, - 0.784, - 0.8, - 0.816, - 0.832, - 0.848, - 0.864, - 0.88, - 0.896, - 0.912, - 0.928, - 0.944, - 0.96, - 0.976, - 0.992, - 1 - ], - "table": [ - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.023706, - 0.04164, - 0.03956054, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - null, - null, - null, - null, - null, - null, - null - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.071654682, - 0.218163956, - 0.347109355, - 0.707410528, - 0.7101572, - 0.714521886, - 0.724138946, - 0.749662831, - 0.771743418, - 0.78068812, - 0.777351611, - 0.760040588, - 0.734964599, - 0.707735189, - 0.67881251, - 0.649277089, - 0.619130809, - 0.588445384, - 0.557293752, - 0.525670827, - 0.493631236, - 0.461239013, - 0.428710429, - 0.396118672, - 0.36353124, - 0.331272913, - 0.29936175, - 0.267774887, - 0.236499989, - 0.205527382, - 0.174631462, - 0.143735542, - 0.112839584, - 0.082193712, - 0.05487704, - 0.035077082, - 0.017589529, - 0, - 0, - 0, - null, - null, - null, - null - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.11384365, - 0.28021182, - 0.731167857, - 0.731746877, - 0.733344981, - 0.761914571, - 0.813147939, - 0.852579142, - 0.879895833, - 0.900087484, - 0.914681498, - 0.92643748, - 0.932025146, - 0.935672912, - 0.936216634, - 0.933764547, - 0.928441671, - 0.920420837, - 0.909739482, - 0.894997965, - 0.876045837, - 0.853289591, - 0.827195791, - 0.798289439, - 0.767083232, - 0.733856099, - 0.698899943, - 0.66232254, - 0.6244297, - 0.585758311, - 0.546243642, - 0.506078186, - 0.46566391, - 0.425637487, - 0.386155955, - 0.347200012, - 0.308764165, - 0.270830841, - 0.233397929, - 0.196477089, - 0.160454165, - 0.126395671, - 0.095160357, - 0.062479974, - 0.026483334, - 0, - null, - null, - null - ], - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0.11327781, - 0.229017497, - 0.352529385, - 0.726907379, - 0.733153683, - 0.734473511, - 0.777951228, - 0.839199655, - 0.886066097, - 0.918911876, - 0.94205339, - 0.958529154, - 0.970252075, - 0.97813029, - 0.98480835, - 0.986720886, - 0.988820801, - 0.990237529, - 0.987881165, - 0.985799968, - 0.982785339, - 0.978744609, - 0.974802669, - 0.967961121, - 0.957981974, - 0.945835368, - 0.932018738, - 0.914989624, - 0.894104207, - 0.870773824, - 0.844629517, - 0.81436259, - 0.780335897, - 0.743943736, - 0.706508331, - 0.668210297, - 0.627605692, - 0.586681264, - 0.545253652, - 0.503595835, - 0.461675008, - 0.419545822, - 0.380137227, - 0.340914586, - 0.301902084, - 0.26320811, - 0.227077077, - 0.196202088, - 0.165685272, - 0.135260417, - 0.099252084, - 0.034576791, - 0, - null, - null - ], - [ - 0.14752927, - 0.195454496, - 0.252279943, - 0.315177918, - 0.380875676, - 0.453470815, - 0.617983921, - 0.652319055, - 0.685022602, - 0.755220845, - 0.814679074, - 0.864853715, - 0.904683419, - 0.933976734, - 0.955608678, - 0.971806987, - 0.983565004, - 0.991776358, - 0.996810839, - 0.999454025, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0.999147848, - 0.996595208, - 0.994104207, - 0.987329, - 0.979657491, - 0.97008667, - 0.958017375, - 0.943480021, - 0.9264328, - 0.9066745, - 0.883690491, - 0.857092692, - 0.82629715, - 0.791246643, - 0.752603963, - 0.711764526, - 0.669355469, - 0.626193848, - 0.582815806, - 0.53950826, - 0.496612142, - 0.454332225, - 0.412979101, - 0.372598241, - 0.332724024, - 0.293440323, - 0.256938756, - 0.22273585, - 0.192366084, - 0.163749835, - 0.131338641, - 0.075224109, - 0, - null, - null - ], - [ - 0.71273652, - 0.750030161, - 0.785739492, - 0.820259247, - 0.853601583, - 0.884948356, - 0.911901164, - 0.934555335, - 0.953122646, - 0.968269338, - 0.980177623, - 0.989221129, - 0.995597117, - 0.999145458, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000228327, - 0.999831136, - 0.996996663, - 0.991083171, - 0.983481242, - 0.974163818, - 0.962508952, - 0.948075765, - 0.93017568, - 0.908572693, - 0.88319224, - 0.854268494, - 0.821813507, - 0.785829519, - 0.74630839, - 0.70333669, - 0.657443237, - 0.610306346, - 0.562759501, - 0.51533193, - 0.468369497, - 0.422251841, - 0.377271449, - 0.333293279, - 0.290521571, - 0.25025678, - 0.212261035, - 0.176019681, - 0.143433533, - 0.111947466, - 0.036266209, - 0, - null, - null - ], - [ - 0.952335345, - 0.962861851, - 0.972258259, - 0.98050379, - 0.987472892, - 0.992967483, - 0.996992105, - 0.999437767, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000711812, - 1.000223814, - 1.00008331, - 0.998717143, - 0.994425964, - 0.987480367, - 0.977858785, - 0.965194397, - 0.949268189, - 0.930027669, - 0.907345683, - 0.881151021, - 0.851564891, - 0.818550568, - 0.782004293, - 0.74175115, - 0.697687225, - 0.650243429, - 0.60079071, - 0.549806112, - 0.497353109, - 0.443579, - 0.388505936, - 0.332285614, - 0.275121256, - 0.217052256, - 0.158101082, - 0.098297354, - 0.03763231, - 0, - 0, - 0, - null, - null - ], - [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000978704, - 1.000123929, - 1.000433223, - 1.000155476, - 0.999416911, - 0.995501404, - 0.988170878, - 0.977699076, - 0.964266358, - 0.948126119, - 0.929550883, - 0.908355306, - 0.883601888, - 0.854754435, - 0.822345988, - 0.78675532, - 0.747661845, - 0.704622091, - 0.657655182, - 0.607425537, - 0.553840688, - 0.494980367, - 0.430992991, - 0.362582372, - 0.286795248, - 0.1978427, - 0.094251874, - 0, - 0, - 0, - 0, - 0, - null, - null - ], - [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.001068035, - 1, - 1.000566031, - 1.00039981, - 1.000281179, - 0.99947703, - 0.995137939, - 0.987093404, - 0.976328634, - 0.963292135, - 0.948348999, - 0.931424764, - 0.911436564, - 0.887533163, - 0.860225016, - 0.830331319, - 0.797312826, - 0.759774933, - 0.717407786, - 0.670107066, - 0.618719839, - 0.563078613, - 0.499293365, - 0.426550725, - 0.345286535, - 0.254695028, - 0.152289454, - 0.017480884, - 0, - 0, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.001018836, - 1, - 1.000539714, - 1.000450297, - 1.000554231, - 1.000295271, - 0.999729513, - 0.996414083, - 0.989560649, - 0.97963918, - 0.966896769, - 0.951602071, - 0.934263814, - 0.91490153, - 0.893087565, - 0.868295797, - 0.839980214, - 0.807522888, - 0.770669708, - 0.729325714, - 0.683190002, - 0.631342366, - 0.572309723, - 0.503807678, - 0.424613749, - 0.34130806, - 0.251240946, - 0.145490374, - 0, - 0, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000870134, - 1, - 1.000412251, - 1.000371386, - 1.000536977, - 1.000474123, - 1.000149609, - 0.999925334, - 0.997950745, - 0.992567851, - 0.983164063, - 0.969894918, - 0.955087891, - 0.938956604, - 0.92146698, - 0.900858866, - 0.876678263, - 0.849934998, - 0.818909353, - 0.78348053, - 0.742989451, - 0.696685028, - 0.64331131, - 0.580691935, - 0.509305827, - 0.431949565, - 0.348958842, - 0.256609065, - 0.147383639, - 0, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000660956, - 1, - 1.000241622, - 1.000227525, - 1.000355543, - 1.000367177, - 1.000177316, - 1.000088847, - 0.999998322, - 0.998716489, - 0.993788889, - 0.984393858, - 0.972777127, - 0.960075558, - 0.94547464, - 0.928713592, - 0.909181324, - 0.887171689, - 0.861867913, - 0.832409779, - 0.797523504, - 0.757344436, - 0.710841863, - 0.656110741, - 0.593423712, - 0.522404885, - 0.445499657, - 0.359952898, - 0.262699446, - 0.140437139, - 0, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000430327, - 1, - 1.000085802, - 1.000083161, - 1.000136051, - 1.000151812, - 1.000084472, - 1.000059185, - 1.000124339, - 1.000143795, - 0.999140523, - 0.994668884, - 0.98718811, - 0.978343506, - 0.967970174, - 0.954970703, - 0.939435832, - 0.92151418, - 0.901042074, - 0.876890157, - 0.848287506, - 0.813690542, - 0.773740489, - 0.727496134, - 0.673696035, - 0.610398814, - 0.53985021, - 0.460823301, - 0.369907043, - 0.261237583, - 0.110538737, - 0, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000217275, - 1, - 1.00000277, - 1.00000274, - 1.00000462, - 1.0000054, - 1.000003227, - 1.000002554, - 1.000006922, - 1.000021604, - 1.000019209, - 0.999762066, - 0.997236826, - 0.99215781, - 0.985214537, - 0.976632629, - 0.966251998, - 0.953367201, - 0.93740136, - 0.917841809, - 0.894117416, - 0.865701622, - 0.83209896, - 0.792797394, - 0.747250891, - 0.693787412, - 0.631141856, - 0.558409942, - 0.474917611, - 0.377272279, - 0.256452988, - 0.050848489, - null, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1.000060823, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1.000033179, - 0.999215596, - 0.996047872, - 0.991702983, - 0.986147868, - 0.978149109, - 0.967190552, - 0.952952576, - 0.934723714, - 0.912378031, - 0.885308228, - 0.852728526, - 0.814278564, - 0.770332743, - 0.716678162, - 0.652663829, - 0.578919932, - 0.492081858, - 0.388540567, - 0.252610601, - 0, - null - ], - [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0.998391724, - 0.995362549, - 0.990088603, - 0.981777242, - 0.969780375, - 0.953738403, - 0.933355306, - 0.907830099, - 0.876827698, - 0.839707743, - 0.795846507, - 0.743832143, - 0.682505239, - 0.609659933, - 0.520594126, - 0.407894109, - 0.251062353, - 0 - ] - ] - }, - "style": { - "upperColor": "green", - "lowerColor": "pink", - "opacity": 0.6 - }, - "buttockHeights": {} - }, - "decks": { - "Deck_A": { - "affiliations": { - "group": "Deck" - }, - "zFloor": 6.686, - "thickness": 0.1, - "xAft": 15.5, - "xFwd": 35.6, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - }, - "Deck_1": { - "affiliations": { - "group": "Deck" - }, - "zFloor": 4.286, - "thickness": 0.1, - "xAft": 0, - "xFwd": 33.68, - "yCentre": 0, - "breadth": 9.6, - "density": 7700 - } - }, - "bulkheads": { - "AB": { - "affiliations": { - "group": "Bulkheads" - }, - "xAft": 5, - "thickness": 0.1, - "density": 7850 - }, - "B23": { - "affiliations": { - "group": "Bulkheads" - }, - "xAft": 22.0, - "thickness": 0.1, - "density": 7850 - }, - "FB": { - "affiliations": { - "group": "Bulkheads" - }, - "xAft": 31.5, - "thickness": 0.1, - "density": 7850 - } - } - }, - "baseObjects": [ - { - "id": "engine_room.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 10.0, - "breadth": 9.6, - "height": 4.216 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "cargo_hold.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 2.5, - "breadth": 7.6, - "height": 2.0 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "control_room.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 2.9, - "breadth": 6.575, - "height": 2.273 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "conf_room.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.9, - "breadth": 2.191, - "height": 2.658 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_4pers_1.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.9, - "breadth": 2.191, - "height": 2.658 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_4pers_2.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.9, - "breadth": 2.191, - "height": 2.658 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_4pers_3.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 4.34, - "breadth": 2.573, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_4pers_4.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 5.3, - "breadth": 3.422, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_4pers_5.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 5.3, - "breadth": 3.422, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Linen.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 1.75, - "breadth": 3.4, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Dry_Prov.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 2.05, - "breadth": 4.829, - "height": 2.158 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Weath_Prot.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.2, - "breadth": 4.8, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Wet_Lab.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.8, - "breadth": 4.15, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Wardrobe_wash.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 6.625, - "breadth": 2.825, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Store_workshop.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 6.625, - "breadth": 2.15, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Dry_lab.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.3, - "breadth": 4.15, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Data_lab.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 4.3, - "breadth": 3.2, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_1pers_1.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.15, - "breadth": 4.938, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Masters.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.21, - "breadth": 4.134, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Cabins_1pers_2.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.648, - "breadth": 4.134, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Bath_1.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 1.416, - "breadth": 3.695, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Vent_El.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 3.75, - "breadth": 5.225, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Bath_2.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 2.09, - "breadth": 0.95, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Conf_room.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 6.16, - "breadth": 6.7, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Disp_Lock.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 0.815, - "breadth": 3.79, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "Whell_House.stl", - "affiliations": { - "group": "Compartment" - }, - "boxDimensions": { - "length": 6.17, - "breadth": 6.7, - "height": 2.215 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "lightweight": 0, - "cg": [ - 0, - 0, - 0 - ] - } - }, - { - "id": "20.CargoHold.#2-8", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 3.0, - "breadth": 7.6, - "height": 2.0 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 0, - "volumeCapacity": 37.82, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.28, - 0.51, - 0.76, - 1.0 - ], - "cgs": [ - [ - 3.01, - 0.0, - 2.11 - ], - [ - 2.81, - 0.0, - 2.44 - ], - [ - 2.75, - 0.0, - 2.67 - ], - [ - 2.73, - 0.0, - 2.91 - ], - [ - 2.71, - 0.0, - 3.14 - ] - ] - } - } - }, - { - "id": "2.No2.sb.FO.#40-48", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 3.724, - "height": 0.796 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 11.852, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.26, - 0.53, - 0.74, - 1.0 - ], - "cgs": [ - [ - 25.72, - -0.35, - 0.28 - ], - [ - 26.53, - -1.04, - 0.73 - ], - [ - 26.61, - -1.23, - 0.95 - ], - [ - 26.64, - -1.31, - 1.1 - ], - [ - 26.67, - -1.38, - 1.26 - ] - ] - } - } - }, - { - "id": "3.No2.p.FO.#40-48", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 3.724, - "height": 0.796 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 11.852, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.26, - 0.53, - 0.74, - 1.0 - ], - "cgs": [ - [ - 25.72, - 0.35, - 0.28 - ], - [ - 26.53, - 1.04, - 0.73 - ], - [ - 26.61, - 1.23, - 0.95 - ], - [ - 26.64, - 1.31, - 1.1 - ], - [ - 26.67, - 1.38, - 1.26 - ] - ] - } - } - }, - { - "id": "8.No6.sb.FO.#20-A.settl", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 1.875, - "height": 1.4 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 7.783, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.25, - 0.49, - 0.74, - 1.0 - ], - "cgs": [ - [ - 13.18, - -0.29, - -0.1 - ], - [ - 12.4, - -0.8, - 0.22 - ], - [ - 12.21, - -0.87, - 0.35 - ], - [ - 12.14, - -0.89, - 0.49 - ], - [ - 12.1, - -0.9, - 0.63 - ] - ] - } - } - }, - { - "id": "9.No6.p.FO.#20-A", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 1.875, - "height": 1.4 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 7.783, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.25, - 0.49, - 0.74, - 1.0 - ], - "cgs": [ - [ - 13.18, - 0.29, - -0.1 - ], - [ - 12.4, - 0.8, - 0.22 - ], - [ - 12.21, - 0.87, - 0.35 - ], - [ - 12.14, - 0.89, - 0.49 - ], - [ - 12.1, - 0.9, - 0.63 - ] - ] - } - } - }, - { - "id": "15.No11.sb.FO.#17-20.serv", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 1.5, - "breadth": 0.7, - "height": 2.107 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 2.212, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.24, - 0.48, - 0.74, - 1.0 - ], - "cgs": [ - [ - 9.25, - -4.15, - 1.66 - ], - [ - 9.25, - -4.15, - 1.92 - ], - [ - 9.25, - -4.15, - 2.18 - ], - [ - 9.25, - -4.15, - 2.46 - ], - [ - 9.25, - -4.15, - 2.74 - ] - ] - } - } - }, - { - "id": "16.No11.p.FO.#16-19.serv", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 1.5, - "breadth": 0.7, - "height": 2.107 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 2.212, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0, - 0.25, - 0.52, - 0.74, - 1.0 - ], - "cgs": [ - [ - 9.85, - 4.15, - 1.66 - ], - [ - 9.85, - 4.15, - 1.93 - ], - [ - 9.85, - 4.15, - 2.22 - ], - [ - 9.85, - 4.15, - 2.46 - ], - [ - 9.85, - 4.15, - 2.74 - ] - ] - } - } - }, - { - "id": "24.No15.sb.FO.#A-I", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 1.875, - "height": 1.255 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 8.244, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.27, - 0.56, - 0.76, - 1.0 - ], - "cgs": [ - [ - 15.9, - -0.26, - 0.09 - ], - [ - 16.85, - -0.82, - 0.23 - ], - [ - 16.93, - -0.88, - 0.4 - ], - [ - 16.95, - -0.9, - 0.51 - ], - [ - 17.02, - -0.91, - 0.64 - ] - ] - } - } - }, - { - "id": "25.No15.p.FO.#A-I", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 1.875, - "height": 1.255 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 830, - "volumeCapacity": 8.244, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.27, - 0.56, - 0.76, - 1.0 - ], - "cgs": [ - [ - 15.9, - 0.26, - 0.09 - ], - [ - 16.85, - 0.82, - 0.23 - ], - [ - 16.93, - 0.88, - 0.4 - ], - [ - 16.95, - 0.9, - 0.51 - ], - [ - 17.02, - 0.91, - 0.64 - ] - ] - } - } - }, - { - "id": "1.No1.#48-51.TW", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 1.5, - "breadth": 4.263, - "height": 1.469 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 8.244, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.26, - 0.54, - 0.74, - 1.0 - ], - "cgs": [ - [ - 30.56, - 0.0, - 0.42 - ], - [ - 30.68, - 0.0, - 0.79 - ], - [ - 30.69, - 0.0, - 1.01 - ], - [ - 30.7, - 0.0, - 1.14 - ], - [ - 30.7, - 0.0, - 1.3 - ] - ] - } - } - }, - { - "id": "4.No3.sb.#32-40", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 3.213, - "height": 0.995 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 12.789, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.23, - 0.53, - 0.78, - 1.0 - ], - "cgs": [ - [ - 22.99, - -1.7, - 0.31 - ], - [ - 23.72, - -2.26, - 0.71 - ], - [ - 23.79, - -2.47, - 0.95 - ], - [ - 23.82, - -2.56, - 1.12 - ], - [ - 23.83, - -2.62, - 1.26 - ] - ] - } - } - }, - { - "id": "5.No3.p.#32-40", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.0, - "breadth": 3.213, - "height": 0.995 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 12.789, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.23, - 0.53, - 0.78, - 1.0 - ], - "cgs": [ - [ - 22.99, - 1.7, - 0.31 - ], - [ - 23.72, - 2.26, - 0.71 - ], - [ - 23.79, - 2.47, - 0.95 - ], - [ - 23.82, - 2.56, - 1.12 - ], - [ - 23.83, - 2.62, - 1.26 - ] - ] - } - } - }, - { - "id": "7.No5.#28-37.FW", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 4.5, - "breadth": 2.8, - "height": 1.66 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 18.446, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.23, - 0.53, - 0.78, - 1.0 - ], - "cgs": [ - [ - 20.96, - 0.0, - 0.07 - ], - [ - 22.02, - 0.0, - 0.43 - ], - [ - 22.07, - 0.0, - 0.61 - ], - [ - 22.09, - 0.0, - 0.78 - ], - [ - 22.33, - 0.0, - 0.95 - ] - ] - } - } - }, - { - "id": "17.No12.#", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 1.5, - "breadth": 9.6, - "height": 1.5 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 21.167, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.24, - 0.51, - 0.75, - 1.0 - ], - "cgs": [ - [ - 5.75, - 0, - 2.61 - ], - [ - 5.75, - 0, - 2.79 - ], - [ - 5.75, - 0, - 2.99 - ], - [ - 5.75, - 0, - 3.18 - ], - [ - 5.75, - 0, - 3.36 - ] - ] - } - } - }, - { - "id": "18.No13.sb.#", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 3.0, - "breadth": 1.0, - "height": 2.0 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.961, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.24, - 0.47, - 0.77, - 1.0 - ], - "cgs": [ - [ - 4.29, - -4.01, - 2.11 - ], - [ - 3.76, - -4.19, - 2.52 - ], - [ - 3.67, - -4.24, - 2.75 - ], - [ - 3.63, - -4.27, - 3.02 - ], - [ - 3.61, - -4.28, - 3.22 - ] - ] - } - } - }, - { - "id": "19.No13.p.#", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 3.0, - "breadth": 1.0, - "height": 2.0 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.961, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.24, - 0.47, - 0.77, - 1.0 - ], - "cgs": [ - [ - 4.29, - 4.01, - 2.11 - ], - [ - 3.76, - 4.19, - 2.52 - ], - [ - 3.67, - 4.24, - 2.75 - ], - [ - 3.63, - 4.27, - 3.02 - ], - [ - 3.61, - 4.28, - 3.22 - ] - ] - } - } - }, - { - "id": "6.No4.#37-40.Dry", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 3.0, - "breadth": 1.0, - "height": 2.0 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 0, - "volumeCapacity": 4.372, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.22, - 0.55, - 0.78, - 1.0 - ], - "cgs": [ - [ - 25.04, - 0.0, - 0.23 - ], - [ - 25.23, - 0.37, - 0.48 - ], - [ - 25.24, - 0.42, - 0.75 - ], - [ - 25.25, - 0.43, - 0.93 - ], - [ - 25.25, - 0.43, - 1.1 - ] - ] - } - } - }, - { - "id": "10.No7.sb.#22-26.Black.sew", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 2.0, - "breadth": 1.656, - "height": 0.977 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.372, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.24, - 0.53, - 0.77, - 1.0 - ], - "cgs": [ - [ - 12.45, - 2.67, - -0.12 - ], - [ - 12.96, - 2.58, - 0.26 - ], - [ - 12.98, - 2.64, - 0.41 - ], - [ - 12.99, - 2.66, - 0.54 - ], - [ - 12.99, - 2.67, - 0.66 - ] - ] - } - } - }, - { - "id": "11.No7.p.#22-26.Grey.sew", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 2.0, - "breadth": 1.656, - "height": 0.977 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 4.372, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.24, - 0.53, - 0.77, - 1.0 - ], - "cgs": [ - [ - 12.45, - -2.67, - 0.12 - ], - [ - 12.96, - -2.58, - -0.26 - ], - [ - 12.98, - -2.64, - -0.41 - ], - [ - 12.99, - -2.66, - -0.54 - ], - [ - 12.99, - -2.67, - -0.66 - ] - ] - } - } - }, - { - "id": "12.No8.#20-22.Sludge", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 1.0, - "breadth": 1.65, - "height": 1.031 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 900, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.25, - 0.5, - 0.75, - 1.0 - ], - "cgs": [ - [ - 11.33, - -2.7, - -0.18 - ], - [ - 11.49, - -2.65, - 0.19 - ], - [ - 11.49, - -2.66, - 0.34 - ], - [ - 11.5, - -2.67, - 0.49 - ], - [ - 11.5, - -2.68, - 0.62 - ] - ] - } - } - }, - { - "id": "13.No9.#18-20.Waste", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 1.0, - "breadth": 1.65, - "height": 1.082 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 900, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.25, - 0.5, - 0.75, - 1.0 - ], - "cgs": [ - [ - 10.34, - -2.69, - -0.25 - ], - [ - 10.48, - -2.69, - 0.1 - ], - [ - 10.49, - -2.69, - 0.29 - ], - [ - 10.5, - -2.69, - 0.44 - ], - [ - 10.5, - -2.69, - 0.59 - ] - ] - } - } - }, - { - "id": "14.No10.#18-22.Bilge", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 2.0, - "breadth": 1.656, - "height": 1.053 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.25, - 0.5, - 0.75, - 1.0 - ], - "cgs": [ - [ - 10.45, - 2.69, - -0.25 - ], - [ - 10.92, - 2.68, - 0.13 - ], - [ - 10.97, - 2.67, - 0.32 - ], - [ - 10.98, - 2.68, - 0.47 - ], - [ - 10.98, - 2.68, - 0.6 - ] - ] - } - } - }, - { - "id": "26.No14.sb.#28-32.Black.w", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 2.0, - "breadth": 1.65, - "height": 0.889 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.26, - 0.51, - 0.7, - 1.0 - ], - "cgs": [ - [ - 15.56, - -2.14, - 0.08 - ], - [ - 15.95, - -2.56, - 0.36 - ], - [ - 15.98, - -2.63, - 0.48 - ], - [ - 15.98, - -2.65, - 0.57 - ], - [ - 15.99, - -2.66, - 0.71 - ] - ] - } - } - }, - { - "id": "27.No14.p.#28-32.Grey.w", - "affiliations": { - "group": "Tank" - }, - "boxDimensions": { - "length": 2.0, - "breadth": 1.65, - "height": 0.889 - }, - "capabilities": {}, - "file3D": "", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 1.701, - "lightweight": 0, - "fullnessCGMapping": { - "fullnesses": [ - 0.0, - 0.26, - 0.51, - 0.7, - 1.0 - ], - "cgs": [ - [ - 15.56, - 2.14, - 0.08 - ], - [ - 15.95, - 2.56, - 0.36 - ], - [ - 15.98, - 2.63, - 0.48 - ], - [ - 15.98, - 2.65, - 0.57 - ], - [ - 15.99, - 2.66, - 0.71 - ] - ] - } - } - }, - { - "id": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "affiliations": { - "group": "Machinery" - }, - "boxDimensions": { - "length": 4.4725, - "breadth": 9.9732, - "height": 2.8 - }, - "capabilities": {}, - "file3D": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 23.915374075452302, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [ - 0, - 0, - 1.45 - ] - ] - } - } - }, - { - "id": "NOGVA_Scania_bk.stl", - "affiliations": { - "group": "Machinery" - }, - "boxDimensions": { - "length": 2.66, - "breadth": 1.273, - "height": 1.629 - }, - "capabilities": {}, - "file3D": "NOGVA_Scania_bk.stl", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 23.915374075452302, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [ - 0, - 0, - 1.45 - ] - ] - } - } - }, - { - "id": "Pallfinger_Crane.stl", - "affiliations": { - "group": "Machinery" - }, - "boxDimensions": { - "length": 21.327, - "breadth": 1.956, - "height": 3.271 - }, - "capabilities": {}, - "file3D": "Pallfinger_Crane.stl", - "baseState": { - "fullness": 0.5 - }, - "weightInformation": { - "contentDensity": 1000, - "volumeCapacity": 23.915374075452302, - "lightweight": 304.5, - "fullnessCGMapping": { - "fullnesses": [], - "cgs": [ - [ - 0, - 0, - 1.45 - ] - ] - } - } - } - ], - "derivedObjects": [ - { - "id": "Propulsion room", - "baseObject": "engine_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 9.150, - "yCentre": 0, - "zBase": 2.385 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "cargo_hold", - "baseObject": "cargo_hold.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 3.75, - "yCentre": 0, - "zBase": 3.576 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "control_room", - "baseObject": "control_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 16.55, - "yCentre": -1.512, - "zBase": 3.411 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "conf_room", - "baseObject": "conf_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 20.05, - "yCentre": -0.109, - "zBase": 3.27 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_4pers_1", - "baseObject": "Cabins_4pers_1.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 20.05, - "yCentre": -3.704, - "zBase": 3.27 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_4pers_2", - "baseObject": "Cabins_4pers_2.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 20.05, - "yCentre": 3.704, - "zBase": 3.27 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_4pers_3", - "baseObject": "Cabins_4pers_3.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.356, - "yCentre": 0.129, - "zBase": 3.52 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_4pers_4", - "baseObject": "Cabins_4pers_4.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.72, - "yCentre": 2.759, - "zBase": 3.52 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_4pers_5", - "baseObject": "Cabins_4pers_5.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 25.114, - "yCentre": -2.704, - "zBase": 3.52 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Linen", - "baseObject": "Linen.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 28.461, - "yCentre": -2.032, - "zBase": 3.52 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Dry_Prov", - "baseObject": "Dry_Prov.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 30.5, - "yCentre": 0.0, - "zBase": 3.52 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Weath_Prot", - "baseObject": "Weath_Prot.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 14.916, - "yCentre": -2.324, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Wet_Lab", - "baseObject": "Wet_Lab.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 18.55, - "yCentre": -2.575, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Wardrobe_wash", - "baseObject": "Wardrobe_wash.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 19.782, - "yCentre": 0.962, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Store_workshop", - "baseObject": "Store_workshop.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 19.782, - "yCentre": 3.575, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Dry_lab", - "baseObject": "Dry_lab.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 22.151, - "yCentre": -2.575, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Data_lab", - "baseObject": "Data_lab.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 26.053, - "yCentre": -3.009, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_1pers_1", - "baseObject": "Cabins_1pers_1.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 29.875, - "yCentre": -1.861, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Masters", - "baseObject": "Masters.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.582, - "yCentre": 2.571, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Cabins_1pers_2", - "baseObject": "Cabins_1pers_2.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 24.582, - "yCentre": 2.571, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Bath_1", - "baseObject": "Bath_1.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 30.685, - "yCentre": 2.232, - "zBase": 5.894 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Vent_El", - "baseObject": "Vent_El.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 18.559, - "yCentre": 0.785, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Bath_2", - "baseObject": "Bath_2.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 19.445, - "yCentre": -2.875, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Conf_room", - "baseObject": "Conf_room.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 23.619, - "yCentre": 0.0, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Disp_Lock", - "baseObject": "Disp_Lock.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 27.163, - "yCentre": -1.41, - "zBase": 8.532 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Whell_House", - "baseObject": "Whell_House.stl", - "affiliations": { - "Deck": "", - "SFI": "109" - }, - "referenceState": { - "xCentre": 17.5, - "yCentre": 0.0, - "zBase": 10.614 - }, - "style": { - "color": "#aabbcc", - "opacity": 1 - } - }, - { - "id": "Tank20", - "baseObject": "20.CargoHold.#2-8", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 3.714, - "yCentre": 0.0, - "zBase": 3.145 - } - }, - { - "id": "Tank2", - "baseObject": "2.No2.sb.FO.#40-48", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 27.665, - "yCentre": -1.385, - "zBase": 1.259 - } - }, - { - "id": "Tank3", - "baseObject": "3.No2.p.FO.#40-48", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 27.665, - "yCentre": 1.385, - "zBase": 1.259 - } - }, - { - "id": "Tank8", - "baseObject": "8.No6.sb.FO.#20-A.settl", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 13.102, - "yCentre": -0.904, - "zBase": 0.627 - } - }, - { - "id": "Tank9", - "baseObject": "9.No6.p.FO.#20-A", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 13.102, - "yCentre": 0.904, - "zBase": 0.627 - } - }, - { - "id": "Tank15", - "baseObject": "15.No11.sb.FO.#17-20.serv", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 9.85, - "yCentre": -4.15, - "zBase": 2.738 - } - }, - { - "id": "Tank16", - "baseObject": "16.No11.p.FO.#16-19.serv", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 9.85, - "yCentre": 4.15, - "zBase": 2.738 - } - }, - { - "id": "Tank24", - "baseObject": "24.No15.sb.FO.#A-I", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 17.018, - "yCentre": -0.906, - "zBase": 0.645 - } - }, - { - "id": "Tank25", - "baseObject": "25.No15.p.FO.#A-I", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 17.018, - "yCentre": 0.906, - "zBase": 0.645 - } - }, - { - "id": "Tank01", - "baseObject": "1.No1.#48-51.TW", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 30.702, - "yCentre": 0, - "zBase": 1.297 - } - }, - { - "id": "Tank04", - "baseObject": "4.No3.sb.#32-40", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 23.834, - "yCentre": -2.62, - "zBase": 1.26 - } - }, - { - "id": "Tank05", - "baseObject": "5.No3.p.#32-40", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 23.834, - "yCentre": 2.62, - "zBase": 1.26 - } - }, - { - "id": "Tank07", - "baseObject": "7.No5.#28-37.FW", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 22.33, - "yCentre": 0.0, - "zBase": 0.951 - } - }, - { - "id": "Tank17", - "baseObject": "17.No12.#", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 5.751, - "yCentre": 0.0, - "zBase": 3.363 - } - }, - { - "id": "Tank18", - "baseObject": "18.No13.sb.#", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 3.606, - "yCentre": -4.285, - "zBase": 3.225 - } - }, - { - "id": "Tank19", - "baseObject": "19.No13.p.#", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 3.606, - "yCentre": 4.285, - "zBase": 3.225 - } - }, - { - "id": "Tank6", - "baseObject": "6.No4.#37-40.Dry", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 25.246, - "yCentre": -0.432, - "zBase": 1.102 - } - }, - { - "id": "Tank10", - "baseObject": "10.No7.sb.#22-26.Black.sew", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 12.992, - "yCentre": -2.669, - "zBase": 0.656 - } - }, - { - "id": "Tank11", - "baseObject": "11.No7.p.#22-26.Grey.sew", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 12.992, - "yCentre": 2.669, - "zBase": 0.656 - } - }, - { - "id": "Tank12", - "baseObject": "12.No8.#20-22.Sludge", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 11.497, - "yCentre": -2.68, - "zBase": 0.621 - } - }, - { - "id": "Tank13", - "baseObject": "13.No9.#18-20.Waste", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 10.497, - "yCentre": -2.692, - "zBase": 0.587 - } - }, - { - "id": "Tank14", - "baseObject": "14.No10.#18-22.Bilge", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 10.985, - "yCentre": 2.685, - "zBase": 0.603 - } - }, - { - "id": "Tank27", - "baseObject": "27.No14.p.#28-32.Grey.w", - "affiliations": { - "Deck": "", - "SFI": "" - }, - "referenceState": { - "xCentre": 15.988, - "yCentre": 2.664, - "zBase": 0.706 - } - }, - { - "id": "SH_GROUP_A_FRAME_ROV_HANGAR", - "baseObject": "SH_GROUP_A_FRAME_ROV_HANGAR.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 11.25, - "yCentre": 3.23, - "zBase": 4.286 - } - }, - { - "id": "NOGVA_Scania_bk_l", - "baseObject": "NOGVA_Scania_bk.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 10.79, - "yCentre": 2.297, - "zBase": 1.44 - } - }, - { - "id": "NOGVA_Scania_bk_c", - "baseObject": "NOGVA_Scania_bk.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 10.79, - "yCentre": 0.0, - "zBase": 1.44 - } - }, - { - "id": "NOGVA_Scania_bk_r", - "baseObject": "NOGVA_Scania_bk.stl", - "affiliations": { - "Deck": "Deck_1", - "SFI": "302" - }, - "referenceState": { - "xCentre": 10.79, - "yCentre": -2.297, - "zBase": 1.44 - } - }, - { - "id": "Pallfinger_Crane", - "baseObject": "Pallfinger_Crane.stl", - "affiliations": { - "Deck": "Deck_A", - "SFI": "302" - }, - "referenceState": { - "xCentre": 5.824, - "yCentre": 3.795, - "zBase": 6.686 - } - } - ] -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/index.html b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/index.html deleted file mode 100644 index 6be1f60..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -Section 2.5 - Importing External Elements - - - diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/index.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/index.js deleted file mode 100644 index 221575c..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/index.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "./fb258c96437db831@80.js"; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/inspector.css b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/inspector.css deleted file mode 100644 index 278bfae..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/inspector.css +++ /dev/null @@ -1 +0,0 @@ -:root{--syntax_normal:#1b1e23;--syntax_comment:#a9b0bc;--syntax_number:#20a5ba;--syntax_keyword:#c30771;--syntax_atom:#10a778;--syntax_string:#008ec4;--syntax_error:#ffbedc;--syntax_unknown_variable:#838383;--syntax_known_variable:#005f87;--syntax_matchbracket:#20bbfc;--syntax_key:#6636b4;--mono_fonts:82%/1.5 Menlo,Consolas,monospace}.observablehq--collapsed,.observablehq--expanded,.observablehq--function,.observablehq--gray,.observablehq--import,.observablehq--string:after,.observablehq--string:before{color:var(--syntax_normal)}.observablehq--collapsed,.observablehq--inspect a{cursor:pointer}.observablehq--field{text-indent:-1em;margin-left:1em}.observablehq--empty{color:var(--syntax_comment)}.observablehq--blue,.observablehq--keyword{color:#3182bd}.observablehq--forbidden,.observablehq--pink{color:#e377c2}.observablehq--orange{color:#e6550d}.observablehq--boolean,.observablehq--null,.observablehq--undefined{color:var(--syntax_atom)}.observablehq--bigint,.observablehq--date,.observablehq--green,.observablehq--number,.observablehq--regexp,.observablehq--symbol{color:var(--syntax_number)}.observablehq--index,.observablehq--key{color:var(--syntax_key)}.observablehq--prototype-key{color:#aaa}.observablehq--empty{font-style:oblique}.observablehq--purple,.observablehq--string{color:var(--syntax_string)}.observablehq--error,.observablehq--red{color:#e7040f}.observablehq--inspect{font:var(--mono_fonts);overflow-x:auto;display:block;white-space:pre}.observablehq--error .observablehq--inspect{word-break:break-all;white-space:pre-wrap} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/package.json b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/package.json deleted file mode 100644 index 9faac07..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "@ferrari212/section-2-5-final-consideration", - "main": "fb258c96437db831@80.js", - "version": "80.0.0", - "homepage": "https://observablehq.com/@ferrari212/section-2-5-final-consideration", - "author": { - "name": "Felipe Ferrari", - "url": "https://observablehq.com/@ferrari212" - }, - "type": "module", - "peerDependencies": { - "@observablehq/runtime": "4 - 5" - } -} \ No newline at end of file diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/runtime.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/runtime.js deleted file mode 100644 index 25e097b..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-5/runtime.js +++ /dev/null @@ -1,2 +0,0 @@ -// @observablehq/runtime v5.9.9 Copyright 2024 Observable, Inc. -function e(e,t,n){n=n||{};var r=e.ownerDocument,a=r.defaultView.CustomEvent;"function"==typeof a?a=new a(t,{detail:n}):((a=r.createEvent("Event")).initEvent(t,!1,!1),a.detail=n),e.dispatchEvent(a)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const a=Symbol.prototype.toString;function o(e){return a.call(e)}const{getOwnPropertySymbols:i,prototype:{hasOwnProperty:s}}=Object,{toStringTag:c}=Symbol,l={},u=i;function f(e,t){return s.call(e,t)}function d(e){return e[c]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}const m=[{symbol:"@@__IMMUTABLE_INDEXED__@@",name:"Indexed",modifier:!0},{symbol:"@@__IMMUTABLE_KEYED__@@",name:"Keyed",modifier:!0},{symbol:"@@__IMMUTABLE_LIST__@@",name:"List",arrayish:!0},{symbol:"@@__IMMUTABLE_MAP__@@",name:"Map"},{symbol:"@@__IMMUTABLE_ORDERED__@@",name:"Ordered",modifier:!0,prefix:!0},{symbol:"@@__IMMUTABLE_RECORD__@@",name:"Record"},{symbol:"@@__IMMUTABLE_SET__@@",name:"Set",arrayish:!0,setish:!0},{symbol:"@@__IMMUTABLE_STACK__@@",name:"Stack",arrayish:!0}];function h(e){try{let t=m.filter((({symbol:t})=>!0===e[t]));if(!t.length)return;const n=t.find((e=>!e.modifier)),r="Map"===n.name&&t.find((e=>e.modifier&&e.prefix)),a=t.some((e=>e.arrayish)),o=t.some((e=>e.setish));return{name:`${r?r.name:""}${n.name}`,symbols:t,arrayish:a&&!o,setish:o}}catch(e){return null}}const{getPrototypeOf:b,getOwnPropertyDescriptors:w}=Object,v=b({});function y(n,a,o,i){let s,c,l,u,f=t(n);n instanceof Map?n instanceof n.constructor?(s=`Map(${n.size})`,c=_):(s="Map()",c=T):n instanceof Set?n instanceof n.constructor?(s=`Set(${n.size})`,c=g):(s="Set()",c=T):f?(s=`${n.constructor.name}(${n.length})`,c=C):(u=h(n))?(s=`Immutable.${u.name}${"Record"===u.name?"":`(${n.size})`}`,f=u.arrayish,c=u.arrayish?N:u.setish?E:A):i?(s=d(n),c=x):(s=d(n),c=T);const p=document.createElement("span");p.className="observablehq--expanded",o&&p.appendChild(r(o));const m=p.appendChild(document.createElement("a"));m.innerHTML="\n \n ",m.appendChild(document.createTextNode(`${s}${f?" [":" {"}`)),m.addEventListener("mouseup",(function(e){e.stopPropagation(),ie(p,L(n,null,o,i))})),c=c(n);for(let e=0;!(l=c.next()).done&&e<20;++e)p.appendChild(l.value);if(!l.done){const t=p.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",(function(t){t.stopPropagation(),p.insertBefore(l.value,p.lastChild.previousSibling);for(let e=0;!(l=c.next()).done&&e<19;++e)p.insertBefore(l.value,p.lastChild.previousSibling);l.done&&p.removeChild(p.lastChild.previousSibling),e(p,"load")}))}return p.appendChild(document.createTextNode(f?"]":"}")),p}function*_(e){for(const[t,n]of e)yield S(t,n);yield*T(e)}function*g(e){for(const t of e)yield q(t);yield*T(e)}function*E(e){for(const t of e)yield q(t)}function*C(e){for(let t=0,n=e.length;t",t.appendChild(document.createTextNode(": ")),t.appendChild(oe(e,void 0,void 0,void 0,!0)),t}function $(e,t,n){const r=document.createElement("div"),a=r.appendChild(document.createElement("span"));return r.className="observablehq--field",a.className=n,a.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t)),r}function S(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(oe(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t)),n}function q(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(oe(e)),t}function O(e){const t=window.getSelection();return"Range"===t.type&&(t.containsNode(e,!0)||t.anchorNode.isSelfOrDescendant(e)||t.focusNode.isSelfOrDescendant(e))}function L(e,n,a,o){let i,s,c,l,u=t(e);if(e instanceof Map?e instanceof e.constructor?(i=`Map(${e.size})`,s=k):(i="Map()",s=U):e instanceof Set?e instanceof e.constructor?(i=`Set(${e.size})`,s=M):(i="Set()",s=U):u?(i=`${e.constructor.name}(${e.length})`,s=R):(l=h(e))?(i=`Immutable.${l.name}${"Record"===l.name?"":`(${e.size})`}`,u=l.arrayish,s=l.arrayish?P:l.setish?I:D):(i=d(e),s=U),n){const t=document.createElement("span");return t.className="observablehq--shallow",a&&t.appendChild(r(a)),t.appendChild(document.createTextNode(i)),t.addEventListener("mouseup",(function(n){O(t)||(n.stopPropagation(),ie(t,L(e)))})),t}const f=document.createElement("span");f.className="observablehq--collapsed",a&&f.appendChild(r(a));const p=f.appendChild(document.createElement("a"));p.innerHTML="\n \n ",p.appendChild(document.createTextNode(`${i}${u?" [":" {"}`)),f.addEventListener("mouseup",(function(t){O(f)||(t.stopPropagation(),ie(f,y(e,0,a,o)))}),!0),s=s(e);for(let e=0;!(c=s.next()).done&&e<20;++e)e>0&&f.appendChild(document.createTextNode(", ")),f.appendChild(c.value);return c.done||f.appendChild(document.createTextNode(", …")),f.appendChild(document.createTextNode(u?"]":"}")),f}function*k(e){for(const[t,n]of e)yield z(t,n);yield*U(e)}function*M(e){for(const t of e)yield oe(t,!0);yield*U(e)}function*I(e){for(const t of e)yield oe(t,!0)}function*P(e){let t=-1,n=0;for(const r=e.size;nt+1&&(yield F(n-t-1)),yield oe(e.get(n),!0),t=n;n>t+1&&(yield F(n-t-1))}function*R(e){let t=-1,r=0;for(const n=e.length;rt+1&&(yield F(r-t-1)),yield oe(p(e,r),!0),t=r);r>t+1&&(yield F(r-t-1));for(const t in e)!n(t)&&f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*U(e){for(const t in e)f(e,t)&&(yield B(t,p(e,t),"observablehq--key"));for(const t of u(e))yield B(o(t),p(e,t),"observablehq--symbol")}function*D(e){for(const[t,n]of e)yield B(t,n,"observablehq--key")}function F(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function B(e,t,n){const r=document.createDocumentFragment(),a=r.appendChild(document.createElement("span"));return a.className=n,a.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(oe(t,!0)),r}function z(e,t){const n=document.createDocumentFragment();return n.appendChild(oe(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(oe(t,!0)),n}function W(e,t){if(e instanceof Date||(e=new Date(+e)),isNaN(e))return"function"==typeof t?t(e):t;const n=e.getUTCHours(),r=e.getUTCMinutes(),a=e.getUTCSeconds(),o=e.getUTCMilliseconds();return`${i=e.getUTCFullYear(),i<0?`-${H(-i,6)}`:i>9999?`+${H(i,6)}`:H(i,4)}-${H(e.getUTCMonth()+1,2)}-${H(e.getUTCDate(),2)}${n||r||a||o?`T${H(n,2)}:${H(r,2)}${a||o?`:${H(a,2)}${o?`.${H(o,3)}`:""}`:""}Z`:""}`;var i}function H(e,t){return`${e}`.padStart(t,"0")}var V=Error.prototype.toString;var G=RegExp.prototype.toString;function Y(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,Z)}function Z(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function J(e,t){for(var n=0;t.exec(e);)++n;return n}var K=Function.prototype.toString,X={prefix:"async ƒ"},Q={prefix:"async ƒ*"},ee={prefix:"class"},te={prefix:"ƒ"},ne={prefix:"ƒ*"};function re(e,t,n){var a=document.createElement("span");a.className="observablehq--function",n&&a.appendChild(r(n));var o=a.appendChild(document.createElement("span"));return o.className="observablehq--keyword",o.textContent=e.prefix,a.appendChild(document.createTextNode(t)),a}const{prototype:{toString:ae}}=Object;function oe(e,t,n,a,i){let s=typeof e;switch(s){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=o(e);break;case"function":return function(e,t){var n,r,a=K.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=X;break;case"AsyncGeneratorFunction":n=Q;break;case"GeneratorFunction":n=ne;break;default:n=/^class\b/.test(a)?ee:te}return n===ee?re(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(a))?re(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))||(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(a))?re(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):re(n,"(…)",t)}(e,a);case"string":return function(e,t,n,a){if(!1===t){if(J(e,/["\n]/g)<=J(e,/`|\${/g)){const t=document.createElement("span");a&&t.appendChild(r(a));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const o=e.split("\n");if(o.length>20&&!n){const n=document.createElement("div");a&&n.appendChild(r(a));const i=n.appendChild(document.createElement("span"));i.className="observablehq--string",i.textContent="`"+Y(o.slice(0,20).join("\n"));const s=n.appendChild(document.createElement("span")),c=o.length-20;return s.textContent=`Show ${c} truncated line${c>1?"s":""}`,s.className="observablehq--string-expand",s.addEventListener("mouseup",(function(r){r.stopPropagation(),ie(n,oe(e,t,!0,a))})),n}const i=document.createElement("span");a&&i.appendChild(r(a));const s=i.appendChild(document.createElement("span"));return s.className="observablehq--string"+(n?" observablehq--expanded":""),s.textContent="`"+Y(e)+"`",i}const o=document.createElement("span");a&&o.appendChild(r(a));const i=o.appendChild(document.createElement("span"));return i.className="observablehq--string",i.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),o}(e,t,n,a);default:if(null===e){s=null,e="null";break}if(e instanceof Date){s="date",e=W(e,"Invalid Date");break}if(e===l){s="forbidden",e="[forbidden]";break}switch(ae.call(e)){case"[object RegExp]":s="regexp",e=function(e){return G.call(e)}(e);break;case"[object Error]":case"[object DOMException]":s="error",e=function(e){return e.stack||V.call(e)}(e);break;default:return(n?y:L)(e,t,a,i)}}const c=document.createElement("span");a&&c.appendChild(r(a));const u=c.appendChild(document.createElement("span"));return u.className=`observablehq--${s}`,u.textContent=e,c}function ie(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const se=/\s+\(\d+:\d+\)$/m;class Inspector{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!function(e){return(e instanceof Element||e instanceof Text)&&e instanceof e.constructor}(t)||t.parentNode&&t.parentNode!==r)&&(t=oe(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:a}=this;for(a.classList.remove("observablehq--running"),a.classList.add("observablehq--error");a.lastChild;)a.removeChild(a.lastChild);var o=document.createElement("div");o.className="observablehq--inspect",n&&o.appendChild(r(n)),o.appendChild(document.createTextNode((t+"").replace(se,""))),a.appendChild(o),e(a,"error",{error:t})}}Inspector.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Inspector(e.appendChild(document.createElement("div")))}};var ce={},le={};function ue(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function fe(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var r in e)r in t||n.push(t[r]=r)})),n}function de(e,t){var n=e+"",r=n.length;return r9999?"+"+de(t,6):de(t,4))+"-"+de(e.getUTCMonth()+1,2)+"-"+de(e.getUTCDate(),2)+(o?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"."+de(o,3)+"Z":a?"T"+de(n,2)+":"+de(r,2)+":"+de(a,2)+"Z":r||n?"T"+de(n,2)+":"+de(r,2)+"Z":"")}function me(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function r(e,t){var r,a=[],o=e.length,i=0,s=0,c=o<=0,l=!1;function u(){if(c)return le;if(l)return l=!1,ce;var t,r,a=i;if(34===e.charCodeAt(a)){for(;i++=o?c=!0:10===(r=e.charCodeAt(i++))?l=!0:13===r&&(l=!0,10===e.charCodeAt(i)&&++i),e.slice(a+1,t-1).replace(/""/g,'"')}for(;i`${e}@${t}/${r}`}}const Ne=Ce("d3","7.9.0","dist/d3.min.js"),xe=Ce("@observablehq/inputs","0.11.0","dist/inputs.min.js"),Te=Ce("@observablehq/plot","0.6.16","dist/plot.umd.min.js"),Ae=Ce("@observablehq/graphviz","0.2.1","dist/graphviz.min.js"),je=Ce("@observablehq/highlight.js","2.0.0","highlight.min.js"),$e=Ce("@observablehq/katex","0.11.1","dist/katex.min.js"),Se=Ce("lodash","4.17.21","lodash.min.js"),qe=Ce("htl","0.3.1","dist/htl.min.js"),Oe=Ce("jszip","3.10.1","dist/jszip.min.js"),Le=Ce("marked","0.3.12","marked.min.js"),ke=Ce("sql.js","1.8.0","dist/sql-wasm.js"),Me=Ce("vega","5.22.1","build/vega.min.js"),Ie=Ce("vega-lite","5.6.0","build/vega-lite.min.js"),Pe=Ce("vega-lite-api","5.0.0","build/vega-lite-api.min.js"),Re=Ce("apache-arrow","4.0.1","Arrow.es2015.min.js"),Ue=Ce("apache-arrow","9.0.0","+esm"),De=Ce("apache-arrow","11.0.0","+esm"),Fe=Ce("arquero","4.8.8","dist/arquero.min.js"),Be=Ce("topojson-client","3.1.0","dist/topojson-client.min.js"),ze=Ce("exceljs","4.3.0","dist/exceljs.min.js"),We=Ce("mermaid","9.2.2","dist/mermaid.min.js"),He=Ce("leaflet","1.9.3","dist/leaflet.js"),Ve=Ce("@duckdb/duckdb-wasm","1.24.0","+esm"),Ge=new Map,Ye=[],Ze=Ye.map,Je=Ye.some,Ke=Ye.hasOwnProperty,Xe=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,Qe=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,et=/(?:\.[^/]*|\/)$/;class RequireError extends Error{constructor(e){super(e)}}function tt(e){const t=Xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function nt(e="https://cdn.jsdelivr.net/npm/",t=["unpkg","jsdelivr","browser","main"]){if(!/\/$/.test(e))throw new Error("origin lacks trailing slash");function n(t){const n=`${e}${t.name}${t.version?`@${t.version}`:""}/package.json`;let r=Ge.get(n);return r||Ge.set(n,r=fetch(n).then((e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!Ge.has(e.url)&&Ge.set(e.url,r),e.json()}))),r}return async function(r,a){if(r.startsWith(e)&&(r=r.substring(e.length)),/^(\w+:)|\/\//i.test(r))return r;if(/^[.]{0,2}\//i.test(r))return new URL(r,null==a?location:a).href;if(!r.length||/^[\s._]/.test(r)||/\s$/.test(r))throw new RequireError("illegal name");const o=tt(r);if(!o)return`${e}${r}`;if(!o.version&&null!=a&&a.startsWith(e)){const t=await n(tt(a.substring(e.length)));o.version=t.dependencies&&t.dependencies[o.name]||t.peerDependencies&&t.peerDependencies[o.name]}if(o.path&&!et.test(o.path)&&(o.path+=".js"),o.path&&o.version&&Qe.test(o.version))return`${e}${o.name}@${o.version}/${o.path}`;const i=await n(o);return`${e}${i.name}@${i.version}/${o.path||function(e){for(const n of t){let t=e[n];if("string"==typeof t)return t.startsWith("./")&&(t=t.slice(2)),et.test(t)?t:`${t}.js`}}(i)||"index.js"}`}}RequireError.prototype.name=RequireError.name;var rt=at(nt());function at(e){const t=new Map,n=a(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise(((t,n)=>{const r=document.createElement("script");r.onload=()=>{try{t(Ye.pop()(a(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()},r.onerror=()=>{n(new RequireError("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=ct,document.head.appendChild(r)}))),n}function a(t){return n=>Promise.resolve(e(n,t)).then(r)}function o(e){return arguments.length>1?Promise.all(Ze.call(arguments,n)).then(ot):n(e)}return o.alias=function(t){return at(((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r)))},o.resolve=e,o}function ot(e){const t={};for(const n of e)for(const e in n)Ke.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:it(n,e)}):t[e]=n[e]);return t}function it(e,t){return()=>e[t]}function st(e){return"exports"===(e+="")||"module"===e}function ct(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),Ye.push(Je.call(t,st)?e=>{const r={},a={exports:r};return Promise.all(Ze.call(t,(t=>"exports"===(t+="")?r:"module"===t?a:e(t)))).then((e=>(n.apply(null,e),a.exports)))}:e=>Promise.all(Ze.call(t,e)).then((e=>"function"==typeof n?n.apply(null,e):n)))}ct.amd={};const lt="https://cdn.observableusercontent.com/npm/";let ut,ft=rt;async function dt(e){const[t,n]=await Promise.all([e(ke.resolve()),e.resolve(ke.resolve("dist/"))]);return t({locateFile:e=>`${n}${e}`})}class SQLiteDatabaseClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}static async open(e){const[t,n]=await Promise.all([dt(ft),Promise.resolve(e).then(mt)]);return new SQLiteDatabaseClient(new t.Database(n))}async query(e,t){return await async function(e,t,n){const[r]=await e.exec(t,n);if(!r)return[];const{columns:a,values:o}=r,i=o.map((e=>Object.fromEntries(e.map(((e,t)=>[a[t],e])))));return i.columns=a,i}(this._db,e,t)}async queryRow(e,t){return(await this.query(e,t))[0]||null}async explain(e,t){return ht("pre",{className:"observablehq--inspect"},[bt((await this.query(`EXPLAIN QUERY PLAN ${e}`,t)).map((e=>e.detail)).join("\n"))])}async describeTables({schema:e}={}){return this.query(`SELECT NULLIF(schema, 'main') AS schema, name FROM pragma_table_list() WHERE type = 'table'${null==e?"":" AND schema = ?"} AND name NOT LIKE 'sqlite_%' ORDER BY schema, name`,null==e?[]:[e])}async describeColumns({schema:e,table:t}={}){if(null==t)throw new Error("missing table");const n=await this.query(`SELECT name, type, "notnull" FROM pragma_table_info(?${null==e?"":", ?"}) ORDER BY cid`,null==e?[t]:[t,e]);if(!n.length)throw new Error(`table not found: ${t}`);return n.map((({name:e,type:t,notnull:n})=>({name:e,type:pt(t),databaseType:t,nullable:!n})))}async describe(e){const t=await(void 0===e?this.query("SELECT name FROM sqlite_master WHERE type = 'table'"):this.query("SELECT * FROM pragma_table_info(?)",[e]));if(!t.length)throw new Error("Not found");const{columns:n}=t;return ht("table",{value:t},[ht("thead",[ht("tr",n.map((e=>ht("th",[bt(e)]))))]),ht("tbody",t.map((e=>ht("tr",n.map((t=>ht("td",[bt(e[t])])))))))])}async sql(){return this.query(...this.queryTag.apply(this,arguments))}queryTag(e,...t){return[e.join("?"),t]}}function pt(e){switch(e){case"NULL":return"null";case"INT":case"INTEGER":case"TINYINT":case"SMALLINT":case"MEDIUMINT":case"BIGINT":case"UNSIGNED BIG INT":case"INT2":case"INT8":return"integer";case"TEXT":case"CLOB":case"DATE":case"DATETIME":return"string";case"REAL":case"DOUBLE":case"DOUBLE PRECISION":case"FLOAT":case"NUMERIC":return"number";case"BLOB":return"buffer";default:return/^(?:(?:(?:VARYING|NATIVE) )?CHARACTER|(?:N|VAR|NVAR)CHAR)\(/.test(e)?"string":/^(?:DECIMAL|NUMERIC)\(/.test(e)?"number":"other"}}function mt(e){return"string"==typeof e?fetch(e).then(mt):e instanceof Response||e instanceof Blob?e.arrayBuffer().then(mt):e instanceof ArrayBuffer?new Uint8Array(e):e}function ht(e,t,n){2===arguments.length&&(n=t,t=void 0);const r=document.createElement(e);if(void 0!==t)for(const e in t)r[e]=t[e];if(void 0!==n)for(const e of n)r.appendChild(e);return r}function bt(e){return document.createTextNode(e)}function wt(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function vt(e,t=wt){let n,r=!1;if(1===t.length){let a;for(const o of e){const e=t(o);(r?wt(e,a)>0:0===wt(e,e))&&(n=o,a=e,r=!0)}}else for(const a of e)(r?t(a,n)>0:0===t(a,a))&&(n=a,r=!0);return n}function yt(e){return e&&"function"==typeof e.toArrowBuffer}function _t(e){return e&&"function"==typeof e.getChild&&"function"==typeof e.toArray&&e.schema&&Array.isArray(e.schema.fields)}function gt(e){return{name:e.name,type:Et(e.type),nullable:e.nullable,databaseType:String(e.type)}}function Et(e){switch(e.typeId){case 2:return"integer";case 3:case 7:return"number";case 4:case 15:return"buffer";case 5:return"string";case 6:return"boolean";case 8:case 9:case 10:return"date";case 12:case 16:return"array";case 13:case 14:return"object";default:return"other"}}async function Ct(){return await import(`${lt}${De.resolve()}`)}Object.defineProperty(SQLiteDatabaseClient.prototype,"dialect",{value:"sqlite"});class DuckDBClient{constructor(e){Object.defineProperties(this,{_db:{value:e}})}async queryStream(e,t){const n=await this._db.connect();let r,a;try{if(t?.length>0){const a=await n.prepare(e);r=await a.send(...t)}else r=await n.send(e);if(a=await r.next(),a.done)throw new Error("missing first batch")}catch(e){throw await n.close(),e}return{schema:(o=a.value,o.schema.fields.map(gt)),async*readRows(){try{for(;!a.done;)yield a.value.toArray(),a=await r.next()}finally{await n.close()}}};var o}async query(e,t){const n=await this.queryStream(e,t),r=[];for await(const e of n.readRows())for(const t of e)r.push(t);return r.schema=n.schema,r}async queryRow(e,t){const n=(await this.queryStream(e,t)).readRows();try{const{done:e,value:t}=await n.next();return e||!t.length?null:t[0]}finally{await n.return()}}async sql(e,...t){return await this.query(e.join("?"),t)}queryTag(e,...t){return[e.join("?"),t]}escape(e){return`"${e}"`}async describeTables(){return(await this.query("SHOW TABLES")).map((({name:e})=>({name:e})))}async describeColumns({table:e}={}){return(await this.query(`DESCRIBE ${this.escape(e)}`)).map((({column_name:e,column_type:t,null:n})=>({name:e,type:At(t),nullable:"NO"!==n,databaseType:t})))}static async of(e={},t={}){const n=await async function(){void 0===ut&&(ut=async function(){const e=await import(`${lt}${Ve.resolve()}`),t=await e.selectBundle({mvp:{mainModule:`${lt}${Ve.resolve("dist/duckdb-mvp.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-mvp.worker.js")}`},eh:{mainModule:`${lt}${Ve.resolve("dist/duckdb-eh.wasm")}`,mainWorker:`${lt}${Ve.resolve("dist/duckdb-browser-eh.worker.js")}`}}),n=new e.ConsoleLogger;return{module:e,bundle:t,logger:n}}());const{module:e,bundle:t,logger:n}=await ut,r=await e.createWorker(t.mainWorker),a=new e.AsyncDuckDB(n,r);return await a.instantiate(t.mainModule),a}();return void 0===t.query?.castTimestampToDate&&(t={...t,query:{...t.query,castTimestampToDate:!0}}),void 0===t.query?.castBigIntToDouble&&(t={...t,query:{...t.query,castBigIntToDouble:!0}}),await n.open(t),await Promise.all(Object.entries(e).map((async([e,t])=>{if(t instanceof FileAttachment)await Nt(n,e,t);else if(_t(t))await xt(n,e,t);else if(Array.isArray(t))await Tt(n,e,t);else if(yt(t))await async function(e,t,n){const r=(await Ct()).tableFromIPC(n.toArrowBuffer());return await xt(e,t,r)}(n,e,t);else if("data"in t){const{data:r,...a}=t;_t(r)?await xt(n,e,r,a):await Tt(n,e,r,a)}else{if(!("file"in t))throw new Error(`invalid source: ${t}`);{const{file:r,...a}=t;await Nt(n,e,r,a)}}}))),new DuckDBClient(n)}}async function Nt(e,t,n,r){const a=await n.url();if(a.startsWith("blob:")){const t=await n.arrayBuffer();await e.registerFileBuffer(n.name,new Uint8Array(t))}else await e.registerFileURL(n.name,new URL(a,location).href,4);const o=await e.connect();try{switch(n.mimeType){case"text/csv":case"text/tab-separated-values":return await o.insertCSVFromPath(n.name,{name:t,schema:"main",...r}).catch((async e=>{if(e.toString().includes("Could not convert"))return await async function(e,t,n){const r=await e.prepare(`CREATE TABLE '${n}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`);return await r.send(t.name)}(o,n,t);throw e}));case"application/json":return await o.insertJSONFromPath(n.name,{name:t,schema:"main",...r});default:if(/\.arrow$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer());return await o.insertArrowFromIPCStream(e,{name:t,schema:"main",...r})}if(/\.parquet$/i.test(n.name))return await o.query(`CREATE VIEW '${t}' AS SELECT * FROM parquet_scan('${n.name}')`);throw new Error(`unknown file type: ${n.mimeType}`)}}finally{await o.close()}}async function xt(e,t,n,r){const a=await e.connect();try{await a.insertArrowTable(n,{name:t,schema:"main",...r})}finally{await a.close()}}async function Tt(e,t,n,r){const a=(await Ct()).tableFromJSON(n);return await xt(e,t,a,r)}function At(e){switch(e){case"BIGINT":case"HUGEINT":case"UBIGINT":return"bigint";case"DOUBLE":case"REAL":case"FLOAT":return"number";case"INTEGER":case"SMALLINT":case"TINYINT":case"USMALLINT":case"UINTEGER":case"UTINYINT":return"integer";case"BOOLEAN":return"boolean";case"DATE":case"TIMESTAMP":case"TIMESTAMP WITH TIME ZONE":return"date";case"VARCHAR":case"UUID":return"string";default:return/^DECIMAL\(/.test(e)?"integer":"other"}}Object.defineProperty(DuckDBClient.prototype,"dialect",{value:"duckdb"});function jt(e){return Array.isArray(e)&&($t(e.schema)||St(e.columns)||function(e){const t=Math.min(20,e.length);for(let n=0;n0&&function(e){for(const t in e)return!0;return!1}(e[0])}(e)||Lt(e)||kt(e))||Mt(e)}function $t(e){return Array.isArray(e)&&e.every(qt)}function St(e){return Array.isArray(e)&&e.every((e=>"string"==typeof e))}function qt(e){return e&&"string"==typeof e.name&&"string"==typeof e.type}function Ot(e){return Mt(e)||Lt(e)||kt(e)}function Lt(e){const t=Math.min(20,e.length);if(!(t>0))return!1;let n,r=!1;for(let a=0;a0))return!1;let n=!1;for(let r=0;r{if(e=await Rt(await e,r),(a=e)&&("function"==typeof a.sql||"function"==typeof a.queryTag&&("function"==typeof a.query||"function"==typeof a.queryStream))&&("table"!==o||"function"==typeof a.describeColumns)&&a!==It)return Ft(e,function(e,t){const n="function"==typeof t.escape?t.escape:e=>e,{select:r,from:a,filter:o,sort:i,slice:s}=e;if(!a.table)throw new Error("missing from table");if(r.columns&&0===r.columns.length)throw new Error("at least one column must be selected");const c=new Map(e.names?.map((({column:e,name:t})=>[e,t]))),l=[[`SELECT ${r.columns?r.columns.map((e=>{const t=c.get(e);return t?`${n(e)} AS ${n(t)}`:n(e)})).join(", "):"*"} FROM ${Bt(a.table,n)}`]];for(let e=0;e{let i=[];fn(e,t).map(((e,t)=>{let n;try{n=o(e)}catch(e){i.push({index:t,error:e}),n=void 0}r[t]?r[t]={...r[t],[a]:n}:r.push({[a]:n})})),i.length&&n.set(a,i)}));const a=un(r,t);e=e.map(((e,t)=>({...e,...a.source[t]}))),o=[...o,...a.schema]}for(const{type:n,operands:r}of t.filter){const[{value:t}]=r,a=r.slice(1).map((({value:e})=>e));switch(n){case"v":{const[n]=a,r=sn(n);e=e.filter((e=>r(e[t])));break}case"nv":{const[n]=a,r=sn(n);e=e.filter((e=>!r(e[t])));break}case"eq":{const[n]=a;if(n instanceof Date){const r=+n;e=e.filter((e=>+e[t]===r))}else e=e.filter((e=>e[t]===n));break}case"ne":{const[n]=a;e=e.filter((e=>e[t]!==n));break}case"c":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&e[t].includes(n)));break}case"nc":{const[n]=a;e=e.filter((e=>"string"==typeof e[t]&&!e[t].includes(n)));break}case"in":{const n=new Set(a);e=e.filter((e=>n.has(e[t])));break}case"nin":{const n=new Set(a);e=e.filter((e=>!n.has(e[t])));break}case"n":e=e.filter((e=>null==e[t]));break;case"nn":e=e.filter((e=>null!=e[t]));break;case"lt":{const[n]=a;e=e.filter((e=>e[t]e[t]<=n));break}case"gt":{const[n]=a;e=e.filter((e=>e[t]>n));break}case"gte":{const[n]=a;e=e.filter((e=>e[t]>=n));break}default:throw new Error(`unknown filter type: ${n}`)}}for(const{column:n,direction:a}of function(e){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(e).reverse()}(t.sort)){const t="desc"===a?Zt:Yt;e===r&&(e=e.slice()),e.sort(((e,r)=>t(e[n],r[n])))}let{from:i,to:s}=t.slice;i=null==i?0:Math.max(0,i),s=null==s?1/0:Math.max(0,s),(i>0||s<1/0)&&(e=e.slice(Math.max(0,i),Math.max(0,s)));let c=o.slice();if(t.select.columns){if(o){const e=new Map(o.map((e=>[e.name,e])));o=t.select.columns.map((t=>e.get(t)))}e=e.map((e=>Object.fromEntries(t.select.columns.map((t=>[t,e[t]])))))}if(t.names){const n=new Map(t.names.map((e=>[e.column,e])));o&&(o=o.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),c&&(c=c.map((e=>{const t=n.get(e.name);return{...e,...t?{name:t.name}:null}}))),e=fn(e,t)}e!==r&&o&&(e.schema=o);return e.fullSchema=c,e.errors=n,e}(e,t);if(!e)throw new Error("missing data source");throw new Error("invalid data source")}),{sql:(e,t,n)=>async function(){return Ft(await Ut(await e,n),arguments,t)}});function Pt(e){const t=new WeakMap;return(n,r)=>{if(!n||"object"!=typeof n)throw new Error("invalid data source");let a=t.get(n);return(!a||jt(n)&&n.length!==a._numRows)&&(a=e(n,r),a._numRows=n.length,t.set(n,a)),a}}const Rt=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":return e.csv();case"text/tab-separated-values":return e.tsv();case"application/json":return e.json();case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return _t(e)||yt(e)?Dt(e,t):jt(e)&&Ot(e)?Array.from(e,(e=>({value:e}))):e})),Ut=Pt((async(e,t)=>{if(e instanceof FileAttachment){switch(e.mimeType){case"text/csv":case"text/tab-separated-values":case"application/json":return Dt(e,t);case"application/x-sqlite3":return e.sqlite()}if(/\.(arrow|parquet)$/i.test(e.name))return Dt(e,t);throw new Error(`unsupported file type: ${e.mimeType}`)}return jt(e)?Dt(await async function(e,t){const n=await Ct();return Ot(e)?n.tableFromArrays({[t]:e}):n.tableFromJSON(e)}(e,t),t):_t(e)||yt(e)?Dt(e,t):e}));function Dt(e,t=(e instanceof FileAttachment?function(e){return e.name.replace(/@\d+(?=\.|$)/,"").replace(/\.\w+$/,"")}(e):"__table")){return DuckDBClient.of({[t]:e})}async function Ft(e,t,n){if(!e)throw new Error("missing data source");if("function"==typeof e.queryTag){const r=new AbortController,a={signal:r.signal};if(n.then((()=>r.abort("invalidated"))),"function"==typeof e.queryStream)return async function*(e){let t=performance.now();const n=await e,r=[];r.done=!1,r.error=null,r.schema=n.schema;try{for await(const e of n.readRows()){performance.now()-t>150&&r.length>0&&(yield r,t=performance.now());for(const t of e)r.push(t)}r.done=!0,yield r}catch(e){r.error=e,yield r}}(e.queryStream(...e.queryTag.apply(e,t),a));if("function"==typeof e.query)return e.query(...e.queryTag.apply(e,t),a)}if("function"==typeof e.sql)return e.sql.apply(e,t);throw new Error("source does not implement query, queryStream, or sql")}function Bt(e,t){if("object"==typeof e){let n="";return null!=e.database&&(n+=t(e.database)+"."),null!=e.schema&&(n+=t(e.schema)+"."),n+=t(e.table),n}return t(e)}function zt(e,t){const n=t[0];n[n.length-1]+=e}function Wt({column:e,direction:t},n,r){zt(`${r(e)} ${t.toUpperCase()}`,n)}function Ht({type:e,operands:t},n,r){if(t.length<1)throw new Error("Invalid operand length");if(1===t.length||"v"===e||"nv"===e)switch(Vt(t[0],n,r),e){case"n":case"nv":return void zt(" IS NULL",n);case"nn":case"v":return void zt(" IS NOT NULL",n);default:throw new Error("Invalid filter operation")}if(2!==t.length||["in","nin"].includes(e)){var a;switch(Vt(t[0],n,r),e){case"in":zt(" IN (",n);break;case"nin":zt(" NOT IN (",n);break;default:throw new Error("Invalid filter operation")}!function(e,t){let n=!0;for(const r of e)n?n=!1:zt(",",t),t.push(r.value),t[0].push("")}(t.slice(1),n),zt(")",n)}else{if(["c","nc"].includes(e)){switch(Vt(t[0],n,r),e){case"c":zt(" LIKE ",n);break;case"nc":zt(" NOT LIKE ",n)}return void Vt((a=t[1],{...a,value:`%${a.value}%`}),n,r)}switch(Vt(t[0],n,r),e){case"eq":zt(" = ",n);break;case"ne":zt(" <> ",n);break;case"gt":zt(" > ",n);break;case"lt":zt(" < ",n);break;case"gte":zt(" >= ",n);break;case"lte":zt(" <= ",n);break;default:throw new Error("Invalid filter operation")}Vt(t[1],n,r)}}function Vt(e,t,n){"column"===e.type?zt(n(e.value),t):(t.push(e.value),t[0].push(""))}function Gt(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))}function Yt(e,t){return Gt(e,t)||(et?1:0)}function Zt(e,t){return Gt(e,t)||(e>t?-1:e"number"==typeof e&&!Number.isNaN(e),Kt=e=>Number.isInteger(e)&&!Number.isNaN(e),Xt=e=>"string"==typeof e,Qt=e=>"boolean"==typeof e,en=e=>"bigint"==typeof e,tn=e=>e instanceof Date&&!isNaN(e),nn=e=>e instanceof ArrayBuffer,rn=e=>Array.isArray(e),an=e=>"object"==typeof e&&null!==e,on=e=>null!=e;function sn(e){switch(e){case"string":return Xt;case"bigint":return en;case"boolean":return Qt;case"number":return Jt;case"integer":return Kt;case"date":return tn;case"buffer":return nn;case"array":return rn;case"object":return an;default:return on}}const cn=/^(([-+]\d{2})?\d{4}(-\d{2}(-\d{2}))|(\d{1,2})\/(\d{1,2})\/(\d{2,4}))([T ]\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/;function ln(e,t){switch(t){case"string":return"string"==typeof e||null==e?e:String(e);case"boolean":if("string"==typeof e){const t=e.trim().toLowerCase();return"true"===t||"false"!==t&&null}return"boolean"==typeof e||null==e?e:Boolean(e);case"bigint":return"bigint"==typeof e||null==e?e:Number.isInteger("string"!=typeof e||e.trim()?+e:NaN)?BigInt(e):void 0;case"integer":case"number":return"number"==typeof e?e:null==e||"string"==typeof e&&!e.trim()?NaN:Number(e);case"date":{if(e instanceof Date||null==e)return e;if("number"==typeof e)return new Date(e);const t=String(e).trim();return"string"!=typeof e||t?new Date(cn.test(t)?t:NaN):null}case"array":case"object":case"buffer":case"other":return e;default:throw new Error(`Unable to coerce to type: ${t}`)}}function un(e,t){const n=e;let{schema:r,inferred:a}=function(e){const{columns:t}=e;let{schema:n}=e;return $t(n)?{schema:n,inferred:!1}:(n=mn(e,St(t)?t:void 0),{schema:n,inferred:!0})}(e);const o=new Map(r.map((({name:e,type:t})=>[e,t])));if(t.types){for(const{name:e,type:a}of t.types){o.set(e,a),r===n.schema&&(r=r.slice());const t=r.findIndex((t=>t.name===e));t>-1&&(r[t]={...r[t],type:a})}e=e.map((e=>dn(e,o,r)))}else a&&(e=e.map((e=>dn(e,o,r))));return{source:e,schema:r}}function fn(e,t){if(!t.names)return e;const n=new Map(t.names.map((e=>[e.column,e])));return e.map((e=>Object.fromEntries(Object.keys(e).map((t=>[n.get(t)?.name??t,e[t]])))))}function dn(e,t,n){const r={};for(const a of n){const n=t.get(a.name),o=e[a.name];r[a.name]="raw"===n?o:ln(o,n)}return r}const pn=["boolean","integer","number","date","bigint","array","object","buffer"];function mn(e,t=function(e){const t=new Set;for(const n of e)if(n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.add(e);return Array.from(t)}(e)){const n=[],r=e.slice(0,100);for(const e of t){const t={boolean:0,integer:0,number:0,date:0,string:0,array:0,object:0,bigint:0,buffer:0,defined:0};for(const n of r){let r=n[e];if(null==r)continue;const a=typeof r;if("string"!==a)++t.defined,Array.isArray(r)?++t.array:r instanceof Date?++t.date:r instanceof ArrayBuffer?++t.buffer:"number"===a?(++t.number,Number.isInteger(r)&&++t.integer):a in t&&++t[a];else{if(r=r.trim(),!r)continue;++t.defined,++t.string,/^(true|false)$/i.test(r)?++t.boolean:r&&!isNaN(r)?(++t.number,Number.isInteger(+r)&&++t.integer):cn.test(r)&&++t.date}}const a=Math.max(1,.9*t.defined),o=vt(pn,(e=>t[e]>=a?t[e]:NaN))??(t.string>=a?"string":"other");n.push({name:e,type:o,inferred:o})}return n}class Workbook{constructor(e){Object.defineProperties(this,{_:{value:e},sheetNames:{value:e.worksheets.map((e=>e.name)),enumerable:!0}})}sheet(e,t){const n="number"==typeof e?this.sheetNames[e]:this.sheetNames.includes(e+="")?e:null;if(null==n)throw new Error(`Sheet not found: ${e}`);return function(e,{range:t,headers:n}={}){let[[r,a],[o,i]]=function(e=":",{columnCount:t,rowCount:n}){if(!(e+="").match(/^[A-Z]*\d*:[A-Z]*\d*$/))throw new Error("Malformed range specifier");const[[r=0,a=0],[o=t-1,i=n-1]]=e.split(":").map(vn);return[[r,a],[o,i]]}(t,e);const s=n?e._rows[a++]:null;let c=new Set(["#"]);for(let e=r;e<=o;e++){const t=s?hn(s.findCell(e+1)):null;let n=t&&t+""||wn(e);for(;c.has(n);)n+="_";c.add(n)}c=new Array(r).concat(Array.from(c));const l=new Array(i-a+1);for(let t=a;t<=i;t++){const n=l[t-a]=Object.create(null,{"#":{value:t+1}}),i=e.getRow(t+1);if(i.hasValues)for(let e=r;e<=o;e++){const t=hn(i.findCell(e+1));null!=t&&(n[c[e+1]]=t)}}return l.columns=c.filter((()=>!0)),l}(this._.getWorksheet(n),t)}}function hn(e){if(!e)return;const{value:t}=e;if(t&&"object"==typeof t&&!(t instanceof Date)){if(t.formula||t.sharedFormula)return t.result&&t.result.error?NaN:t.result;if(t.richText)return bn(t);if(t.text){let{text:e}=t;return e.richText&&(e=bn(e)),t.hyperlink&&t.hyperlink!==e?`${t.hyperlink} ${e}`:e}return t}return t}function bn(e){return e.richText.map((e=>e.text)).join("")}function wn(e){let t="";e++;do{t=String.fromCharCode(64+(e%26||26))+t}while(e=Math.floor((e-1)/26));return t}function vn(e){const[,t,n]=e.match(/^([A-Z]*)(\d*)$/);let r=0;if(t)for(let e=0;e[e,t])));return Object.assign(e.map((e=>dn(e,n,t))),{schema:t})}(e,mn(e,e.columns))}return o(a,r&&ge)}class gn{constructor(e,t){Object.defineProperty(this,"name",{value:e,enumerable:!0}),void 0!==t&&Object.defineProperty(this,"mimeType",{value:t+"",enumerable:!0})}async blob(){return(await yn(this)).blob()}async arrayBuffer(){return(await yn(this)).arrayBuffer()}async text(){return(await yn(this)).text()}async json(){return(await yn(this)).json()}async stream(){return(await yn(this)).body}async csv(e){return _n(this,",",e)}async tsv(e){return _n(this,"\t",e)}async image(e){const t=await this.url();return new Promise(((n,r)=>{const a=new Image;new URL(t,document.baseURI).origin!==new URL(location).origin&&(a.crossOrigin="anonymous"),Object.assign(a,e),a.onload=()=>n(a),a.onerror=()=>r(new Error(`Unable to load file: ${this.name}`)),a.src=t}))}async arrow({version:e=4}={}){switch(e){case 4:{const[e,t]=await Promise.all([ft(Re.resolve()),yn(this)]);return e.Table.from(t)}case 9:{const[e,t]=await Promise.all([import(`${lt}${Ue.resolve()}`),yn(this)]);return e.tableFromIPC(t)}case 11:{const[e,t]=await Promise.all([import(`${lt}${De.resolve()}`),yn(this)]);return e.tableFromIPC(t)}default:throw new Error(`unsupported arrow version: ${e}`)}}async sqlite(){return SQLiteDatabaseClient.open(yn(this))}async zip(){const[e,t]=await Promise.all([ft(Oe.resolve()),this.arrayBuffer()]);return new ZipArchive(await e.loadAsync(t))}async xml(e="application/xml"){return(new DOMParser).parseFromString(await this.text(),e)}async html(){return this.xml("text/html")}async xlsx(){const[e,t]=await Promise.all([ft(ze.resolve()),this.arrayBuffer()]);return new Workbook(await(new e.Workbook).xlsx.load(t))}}class FileAttachment extends gn{constructor(e,t,n){super(t,n),Object.defineProperty(this,"_url",{value:e})}async url(){return await this._url+""}}function En(e){throw new Error(`File not found: ${e}`)}class ZipArchive{constructor(e){Object.defineProperty(this,"_",{value:e}),this.filenames=Object.keys(e.files).filter((t=>!e.files[t].dir))}file(e){const t=this._.file(e+="");if(!t||t.dir)throw new Error(`file not found: ${e}`);return new ZipArchiveEntry(t)}}class ZipArchiveEntry extends gn{constructor(e){super(e.name),Object.defineProperty(this,"_",{value:e}),Object.defineProperty(this,"_url",{writable:!0})}async url(){return this._url||(this._url=this.blob().then(URL.createObjectURL))}async blob(){return this._.async("blob")}async arrayBuffer(){return this._.async("arraybuffer")}async text(){return this._.async("text")}async json(){return JSON.parse(await this.text())}}var Cn={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Nn=0;function xn(e){return new Tn("O-"+(null==e?"":e+"-")+ ++Nn)}function Tn(e){this.id=e,this.href=new URL(`#${e}`,location)+""}Tn.prototype.toString=function(){return"url("+this.href+")"};var An=Object.freeze({__proto__:null,canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var a=r.getContext("2d");return a.scale(n,n),a},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),a=r.appendChild(document.createElement("button"));async function o(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),a.textContent=n,a.disabled=!1}return a.textContent=n,r.download=t,r.onclick=async t=>{if(a.disabled=!0,r.href)return o();a.textContent="Saving…";try{const t=await("function"==typeof e?e():e);a.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){a.textContent=n}if(t.eventPhase)return o();a.disabled=!1},r},element:function(e,t){var n,r=e+="",a=r.indexOf(":");a>=0&&"xmlns"!==(r=e.slice(0,a))&&(e=e.slice(a+1));var o=Cn.hasOwnProperty(r)?document.createElementNS(Cn[r],e):document.createElement(e);if(t)for(var i in t)a=(r=i).indexOf(":"),n=t[i],a>=0&&"xmlns"!==(r=i.slice(0,a))&&(i=i.slice(a+1)),Cn.hasOwnProperty(r)?o.setAttributeNS(Cn[r],i,n):o.setAttribute(i,n);return o},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,(function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)})),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:xn});var jn=Object.freeze({__proto__:null,buffer:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)}))},text:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)}))},url:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)}))}});function $n(){return this}function Sn(e,t){let n=!1;if("function"!=typeof t)throw new Error("dispose is not a function");return{[Symbol.iterator]:$n,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function qn(e){let t,n,r=!1;const a=e((function(e){n?(n(e),n=null):r=!0;return t=e}));if(null!=a&&"function"!=typeof a)throw new Error("function"==typeof a.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=a&&a(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise((e=>n=e))}}}}function On(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,(e=>e.value));default:return e.value}}var Ln=Object.freeze({__proto__:null,disposable:Sn,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return qn((function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=On(e);function a(){t(On(e))}return e.addEventListener(n,a),void 0!==r&&t(r),function(){e.removeEventListener(n,a)}}))},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:qn,queue:function(e){let t;const n=[],r=e((function(e){n.push(e),t&&(t(n.shift()),t=null);return e}));if(null!=r&&"function"!=typeof r)throw new Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:$n,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise((e=>t=e))}}}},range:function*(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)}))}});function kn(e,t){return function(n){var r,a,o,i,s,c,l,u,f=n[0],d=[],p=null,m=-1;for(s=1,c=arguments.length;s0){for(o=new Array(m),i=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);i.nextNode();)a=i.currentNode,/^o:/.test(a.nodeValue)&&(o[+a.nodeValue.slice(2)]=a);for(s=0;s{t=e}))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*Pn(){for(;;)yield Date.now()}var Rn=new Map;function Un(e,t){var n;return(n=Rn.get(e=+e))?n.then((()=>t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise((function(n){Rn.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)}));return Rn.set(t,n),n}(n,e).then((()=>t))}var Dn=Object.freeze({__proto__:null,delay:function(e,t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))},tick:function(e,t){return Un(Math.ceil((Date.now()+1)/e)*e,t)},when:Un});function Fn(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const Bn=kn((function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t}),(function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}));var zn=String.raw;function Wn(e){return new Promise((function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)}))}function Hn(){return qn((function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}}))}const Library=Object.assign(Object.defineProperties((function(e){const t=function(e){return null==e?ft:at(e)}(e);var n;Object.defineProperties(this,(n={FileAttachment:()=>En,Mutable:()=>In,now:Pn,width:Hn,dot:()=>t(Ae.resolve()),htl:()=>t(qe.resolve()),html:()=>Mn,md:()=>function(e){return e(Le.resolve()).then((function(t){return kn((function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var a=r.querySelectorAll("pre code[class]");return a.length>0&&e(je.resolve()).then((function(t){a.forEach((function(n){function r(){t.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}t.getLanguage(n.className)?r():e(je.resolve("async-languages/index.js")).then((r=>{if(r.has(n.className))return e(je.resolve("async-languages/"+r.get(n.className))).then((e=>{t.registerLanguage(n.className,e)}))})).then(r,r)}))})),r}),(function(){return document.createElement("div")}))}))}(t),svg:()=>Bn,tex:()=>function(e){return Promise.all([e($e.resolve()),e.resolve($e.resolve("dist/katex.min.css")).then(Wn)]).then((function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(zn.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n}))}(t),_:()=>t(Se.resolve()),aq:()=>t.alias({"apache-arrow":Re.resolve()})(Fe.resolve()),Arrow:()=>t(Re.resolve()),d3:()=>t(Ne.resolve()),DuckDBClient:()=>DuckDBClient,Inputs:()=>t(xe.resolve()).then((e=>({...e,file:e.fileOf(gn)}))),L:()=>async function(e){const t=await e(He.resolve());if(!t._style){const n=document.createElement("link");n.rel="stylesheet",n.href=await e.resolve(He.resolve("dist/leaflet.css")),t._style=document.head.appendChild(n)}return t}(t),mermaid:()=>async function(e){const t=await e(We.resolve());return t.initialize({securityLevel:"loose",theme:"neutral"}),function(){const e=document.createElement("div");return e.innerHTML=t.render(xn().id,String.raw.apply(String,arguments)),e.removeChild(e.firstChild)}}(t),Plot:()=>t(Te.resolve()),__query:()=>It,require:()=>t,resolve:()=>Fn,SQLite:()=>dt(t),SQLiteDatabaseClient:()=>SQLiteDatabaseClient,topojson:()=>t(Be.resolve()),vl:()=>async function(e){const[t,n,r]=await Promise.all([Me,Ie,Pe].map((t=>e(t.resolve()))));return r.register(t,n)}(t),aapl:()=>new FileAttachment("https://static.observableusercontent.com/files/3ccff97fd2d93da734e76829b2b066eafdaac6a1fafdec0faf6ebc443271cfc109d29e80dd217468fcb2aff1e6bffdc73f356cc48feb657f35378e6abbbb63b9").csv({typed:!0}),alphabet:()=>new FileAttachment("https://static.observableusercontent.com/files/75d52e6c3130b1cae83cda89305e17b50f33e7420ef205587a135e8562bcfd22e483cf4fa2fb5df6dff66f9c5d19740be1cfaf47406286e2eb6574b49ffc685d").csv({typed:!0}),cars:()=>new FileAttachment("https://static.observableusercontent.com/files/048ec3dfd528110c0665dfa363dd28bc516ffb7247231f3ab25005036717f5c4c232a5efc7bb74bc03037155cb72b1abe85a33d86eb9f1a336196030443be4f6").csv({typed:!0}),citywages:()=>new FileAttachment("https://static.observableusercontent.com/files/39837ec5121fcc163131dbc2fe8c1a2e0b3423a5d1e96b5ce371e2ac2e20a290d78b71a4fb08b9fa6a0107776e17fb78af313b8ea70f4cc6648fad68ddf06f7a").csv({typed:!0}),diamonds:()=>new FileAttachment("https://static.observableusercontent.com/files/87942b1f5d061a21fa4bb8f2162db44e3ef0f7391301f867ab5ba718b225a63091af20675f0bfe7f922db097b217b377135203a7eab34651e21a8d09f4e37252").csv({typed:!0}),flare:()=>new FileAttachment("https://static.observableusercontent.com/files/a6b0d94a7f5828fd133765a934f4c9746d2010e2f342d335923991f31b14120de96b5cb4f160d509d8dc627f0107d7f5b5070d2516f01e4c862b5b4867533000").csv({typed:!0}),industries:()=>new FileAttachment("https://static.observableusercontent.com/files/76f13741128340cc88798c0a0b7fa5a2df8370f57554000774ab8ee9ae785ffa2903010cad670d4939af3e9c17e5e18e7e05ed2b38b848ac2fc1a0066aa0005f").csv({typed:!0}),miserables:()=>new FileAttachment("https://static.observableusercontent.com/files/31d904f6e21d42d4963ece9c8cc4fbd75efcbdc404bf511bc79906f0a1be68b5a01e935f65123670ed04e35ca8cae3c2b943f82bf8db49c5a67c85cbb58db052").json(),olympians:()=>new FileAttachment("https://static.observableusercontent.com/files/31ca24545a0603dce099d10ee89ee5ae72d29fa55e8fc7c9ffb5ded87ac83060d80f1d9e21f4ae8eb04c1e8940b7287d179fe8060d887fb1f055f430e210007c").csv({typed:!0}),penguins:()=>new FileAttachment("https://static.observableusercontent.com/files/715db1223e067f00500780077febc6cebbdd90c151d3d78317c802732252052ab0e367039872ab9c77d6ef99e5f55a0724b35ddc898a1c99cb14c31a379af80a").csv({typed:!0}),pizza:()=>new FileAttachment("https://static.observableusercontent.com/files/c653108ab176088cacbb338eaf2344c4f5781681702bd6afb55697a3f91b511c6686ff469f3e3a27c75400001a2334dbd39a4499fe46b50a8b3c278b7d2f7fb5").csv({typed:!0}),weather:()=>new FileAttachment("https://static.observableusercontent.com/files/693a46b22b33db0f042728700e0c73e836fa13d55446df89120682d55339c6db7cc9e574d3d73f24ecc9bc7eb9ac9a1e7e104a1ee52c00aab1e77eb102913c1f").csv({typed:!0}),DOM:An,Files:jn,Generators:Ln,Promises:Dn},Object.fromEntries(Object.entries(n).map(Vn))))}),{resolve:{get:()=>ft.resolve,enumerable:!0,configurable:!0},require:{get:()=>ft,set:function(e){ft=e},enumerable:!0,configurable:!0}}),{resolveFrom:nt,requireFrom:at});function Vn([e,t]){return[e,{value:t,writable:!0,enumerable:!0}]}class RuntimeError extends Error{constructor(e,t){super(e),this.input=t}}function Gn(e){return()=>e}function Yn(e){return e}RuntimeError.prototype.name="RuntimeError";const Zn=Array.prototype.map;function Jn(){}const Kn=Symbol("no-observer");function Variable(e,t,n,r){var a;n||(n=Kn),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tr,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:NaN,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Jn,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Kn,writable:!0},_rejector:{value:(a=this,e=>{if(e===nr)throw e;if(e===tr)throw new RuntimeError(`${a._name} is not defined`,a._name);if(e instanceof Error&&e.message)throw new RuntimeError(e.message,a._name);throw new RuntimeError(`${a._name} could not be resolved`,a._name)})},_shadow:{value:Xn(t,r)},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Xn(e,t){return t?.shadow?new Map(Object.entries(t.shadow).map((([t,n])=>[t,new Variable(2,e).define([],n)]))):null}function Qn(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function er(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tr(){throw tr}function nr(){throw nr}function rr(e){return()=>{throw new RuntimeError(`${e} is defined more than once`)}}function ar(e,t,n){const r=this._module._scope,a=this._module._runtime;if(this._inputs.forEach(er,this),t.forEach(Qn,this),this._inputs=t,this._definition=n,this._value=void 0,n===Jn?a._variables.delete(this):a._variables.add(this),e!==this._name||r.get(e)!==this){let t,o;if(this._name)if(this._outputs.size)r.delete(this._name),o=this._module._resolve(this._name),o._outputs=this._outputs,this._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(this)]=o}),this),o._outputs.forEach(a._updates.add,a._updates),a._dirty.add(o).add(this),r.set(this._name,o);else if((o=r.get(this._name))===this)r.delete(this._name);else{if(3!==o._type)throw new Error;o._duplicates.delete(this),this._duplicate=void 0,1===o._duplicates.size&&(o=o._duplicates.keys().next().value,t=r.get(this._name),o._outputs=t._outputs,t._outputs=new Set,o._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(t)]=o})),o._definition=o._duplicate,o._duplicate=void 0,a._dirty.add(t).add(o),a._updates.add(o),r.set(this._name,o))}if(this._outputs.size)throw new Error;e&&((o=r.get(e))?3===o._type?(this._definition=rr(e),this._duplicate=n,o._duplicates.add(this)):2===o._type?(this._outputs=o._outputs,o._outputs=new Set,this._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=this}),this),a._dirty.add(o).add(this),r.set(e,this)):(o._duplicate=o._definition,this._duplicate=n,t=new Variable(3,this._module),t._name=e,t._definition=this._definition=o._definition=rr(e),t._outputs=o._outputs,o._outputs=new Set,t._outputs.forEach((function(e){e._inputs[e._inputs.indexOf(o)]=t})),t._duplicates=new Set([this,o]),a._dirty.add(o).add(t),a._updates.add(o).add(t),r.set(e,t)):r.set(e,this)),this._name=e}return this._version>0&&++this._version,a._updates.add(this),a._compute(),this}Object.defineProperties(Variable.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},_resolve:{value:function(e){return this._shadow?.get(e)??this._module._resolve(e)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ar.call(this,null==e?null:String(e),null==t?[]:Zn.call(t,this._resolve,this),"function"==typeof n?n:Gn(n))},writable:!0,configurable:!0},delete:{value:function(){return ar.call(this,null,[],Jn)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ar.call(this,String(t),[n._resolve(String(e))],Yn)},writable:!0,configurable:!0}});const or=Symbol("variable"),ir=Symbol("invalidation"),sr=Symbol("visibility");function Module(e,t=[]){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map},_builtins:{value:new Map([["@variable",or],["invalidation",ir],["visibility",sr],...t])},_source:{value:null,writable:!0}})}async function cr(e,t){await e._compute();try{return await t._promise}catch(n){if(n===nr)return cr(e,t);throw n}}function lr(e){return e._name}Object.defineProperties(Module.prototype,{_resolve:{value:function(e){let t,n=this._scope.get(e);if(!n)if(n=new Variable(2,this),this._builtins.has(e))n.define(e,Gn(this._builtins.get(e)));else if(this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,function(e){return()=>{throw e}}(t))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Gn(t))}return n},writable:!0,configurable:!0},redefine:{value:function(e){const t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(3===t._type)throw new RuntimeError(`${e} is defined more than once`);return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){const e=new Variable(1,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){const n=new Map,r=new Set,a=[];function o(e){let t=n.get(e);return t||(t=new Module(e._runtime,e._builtins),t._source=e,n.set(e,t),a.push([t,e]),r.add(e),t)}const i=o(this);for(const n of e){const{alias:e,name:r}="object"==typeof n?n:{name:n};i.import(r,null==e?r:e,t)}for(const e of r)for(const[t,n]of e._scope)if(n._definition===Yn){if(e===this&&i._scope.has(t))continue;const r=n._inputs[0]._module;r._source&&o(r)}for(const[e,t]of a)for(const[r,a]of t._scope){const t=e._scope.get(r);if(!t||2===t._type)if(a._definition===Yn){const t=a._inputs[0],o=t._module;e.import(t._name,r,n.get(o)||o)}else e.define(r,a._inputs.map(lr),a._definition)}return i},writable:!0,configurable:!0},import:{value:function(){const e=new Variable(1,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},value:{value:async function(e){let t=this._scope.get(e);if(!t)throw new RuntimeError(`${e} is not defined`);if(t._observer!==Kn)return cr(this._runtime,t);t=this.variable(!0).define([e],Yn);try{return await cr(this._runtime,t)}finally{t.delete()}},writable:!0,configurable:!0},variable:{value:function(e,t){return new Variable(1,this,e,t)},writable:!0,configurable:!0},builtin:{value:function(e,t){this._builtins.set(e,t)},writable:!0,configurable:!0}});const ur="function"==typeof requestAnimationFrame?requestAnimationFrame:"function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);function Runtime(e=new Library,t=yr){const n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_precomputes:{value:[],writable:!0},_computing:{value:null,writable:!0},_init:{value:null,writable:!0},_modules:{value:new Map},_variables:{value:new Set},_disposed:{value:!1,writable:!0},_builtin:{value:n},_global:{value:t}}),e)for(const t in e)new Variable(2,n).define(t,[],e[t])}function fr(e){const t=new Set(e._inputs);for(const n of t){if(n===e)return!0;n._inputs.forEach(t.add,t)}return!1}function dr(e){++e._indegree}function pr(e){--e._indegree}function mr(e){return e._promise.catch(e._rejector)}function hr(e){return new Promise((function(t){e._invalidate=t}))}function br(e,t){let n,r,a="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,o=!a,i=Jn,s=Jn;return a&&(r=new IntersectionObserver((([e])=>(o=e.isIntersecting)&&(n=null,i()))),r.observe(a),e.then((()=>(r.disconnect(),r=null,s())))),function(e){return o?Promise.resolve(e):r?(n||(n=new Promise(((e,t)=>(i=e,s=t)))),n.then((()=>e))):Promise.reject()}}function wr(e){e._invalidate(),e._invalidate=Jn,e._pending();const t=e._value,n=++e._version;let r=null;const a=e._promise=(e._inputs.length?Promise.all(e._inputs.map(mr)).then((function(a){if(e._version!==n)throw nr;for(let t=0,n=a.length;tn(e._definition.call(t))))).then((function(t){if(e._version!==n)throw nr;if(function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t))return(r||hr(e)).then((a=t,function(){a.return()})),function(e,t,n){const r=e._module._runtime;let a;function o(e){return new Promise((e=>e(n.next(a)))).then((({done:t,value:n})=>t?void 0:Promise.resolve(n).then(e)))}function i(){const n=o((o=>{if(e._version!==t)throw nr;return a=o,s(o,n).then((()=>r._precompute(i))),e._fulfilled(o),o}));n.catch((r=>{r!==nr&&e._version===t&&(s(void 0,n),e._rejected(r))}))}function s(t,n){return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}return o((n=>{if(e._version!==t)throw nr;return a=n,r._precompute(i),n}))}(e,n,t);var a;return t}));a.then((t=>{e._value=t,e._fulfilled(t)}),(t=>{t!==nr&&e._version===n&&(e._value=void 0,e._rejected(t))}))}function vr(e,t){e._invalidate(),e._invalidate=Jn,e._pending(),++e._version,e._indegree=NaN,(e._promise=Promise.reject(t)).catch(Jn),e._value=void 0,e._rejected(t)}function yr(e){return globalThis[e]}Object.defineProperties(Runtime.prototype,{_precompute:{value:function(e){this._precomputes.push(e),this._compute()},writable:!0,configurable:!0},_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){return new Promise(ur).then((()=>this._disposed?void 0:this._computeNow()))},writable:!0,configurable:!0},_computeNow:{value:async function(){let e,t,n=[],r=this._precomputes;if(r.length){this._precomputes=[];for(const e of r)e();await function(e=0){let t=Promise.resolve();for(let n=0;n{}));return t}(3)}e=new Set(this._dirty),e.forEach((function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Kn)return!0;const t=new Set(e._outputs);for(const e of t){if(e._observer!==Kn)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n{e._invalidate(),e._version=NaN}))},writable:!0,configurable:!0},module:{value:function(e,t=Jn){let n;if(void 0===e)return(n=this._init)?(this._init=null,n):new Module(this);if(n=this._modules.get(e),n)return n;this._init=n=new Module(this),this._modules.set(e,n);try{e(this,t)}finally{this._init=null}return n},writable:!0,configurable:!0},fileAttachments:{value:function(e){return Object.assign((t=>{const n=e(t+="");if(null==n)throw new Error(`File not found: ${t}`);if("object"==typeof n&&"url"in n){const{url:e,mimeType:r}=n;return new FileAttachment(e,t,r)}return new FileAttachment(n,t)}),{prototype:FileAttachment.prototype})},writable:!0,configurable:!0}});export{Inspector,Library,Runtime,RuntimeError}; diff --git a/examples/observable_examples/from_concept_to_simulation_intro/section-2-6/215095beab0a6558@361.js b/examples/observable_examples/from_concept_to_simulation_intro/section-2-6/215095beab0a6558@361.js deleted file mode 100644 index 6a73155..0000000 --- a/examples/observable_examples/from_concept_to_simulation_intro/section-2-6/215095beab0a6558@361.js +++ /dev/null @@ -1,180 +0,0 @@ -// ./section-2-6/index.html@361 -function _1(md){return( -md` -# Section 2.6 - Creating a GLTF realistic model - -A good practice for a realistic model is using the GLTF format. To introduce the model it will be used the snippets that allows the introduction of GLTF model **[1]** in the THEE.js library: - -` -)} - -function _loaderGLTF(THREE){return( -new THREE.GLTFLoader() -)} - -function _3(md){return( -md` -The GLTF model is going to be imported from a external source as showed in defined in [boatPath](https://github.com/ferrari212/vesseljs/blob/master/examples/3D_models/GLTF/Gunnerus.glb): -` -)} - -function _boatPath(){return( -"https://ferrari212.github.io/vesseljs/examples/3D_models/GLTF/Gunnerus.glb" -)} - -function _5(md){return( -md` -The following code is responsible for inserting the defined path into the scene: -` -)} - -function _6(loaderGLTF,boatPath,THREE,scene,$0) -{ - loaderGLTF.load( - boatPath, - (gltf) => { - var shipGLTF = gltf.scene; - shipGLTF.rotation.x = Math.PI / 2; - shipGLTF.rotation.y = -Math.PI / 2; - shipGLTF.position.set(-1, 0, 0); - shipGLTF.name = "ModelGLTF"; - - if (shipGLTF.material) { - shipGLTF.material.side = THREE.DoubleSide; - } - - scene.add(shipGLTF); - }, - (xhr) => { - $0.value = (xhr.loaded / 31780028) * 100; - } - ); -} - - -function _7(md,loaderPecentage){return( -md`## *The 3D model is* ${loaderPecentage | 0} % *loaded*` -)} - -function _8(html,loaderPecentage){return( -html` - - - - -` -)} - -function* _9(THREE,scene,width,invalidation) -{ - const renderer = new THREE.WebGLRenderer({antialias: true}); - renderer.toneMapping = THREE.ReinhardToneMapping; - renderer.toneMappingExposure = 2.3; - - scene.background = new THREE.Color(0xA9CCE3); - - const height = 600; - const aspect = width / height; - const camera = new THREE.PerspectiveCamera(50, aspect); - camera.up.set(0, 0, 1); - scene.add(camera); - camera.position.set(30, 20, 20); - - function onWindowResize() { - renderer.setSize(width, height); - camera.aspect = width / height; - camera.updateProjectionMatrix(); - } - window.addEventListener('resize', onWindowResize); - - - const controls = new THREE.OrbitControls(camera, renderer.domElement); - controls.target = new THREE.Vector3(0, 0, 0); - controls.update(); - invalidation.then(() => renderer.dispose()); - renderer.setSize(width, height); - renderer.setPixelRatio(devicePixelRatio); - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.3); - const mainLight = new THREE.DirectionalLight(0xffffff, 1); - mainLight.position.set(1, 1, 1); - scene.add(ambientLight, mainLight); - - var animate = function () { - requestAnimationFrame( animate ); - renderer.render( scene, camera ); - }; - animate(); - yield renderer.domElement; -} - - -function _10(md){return( -md ` -
Gunnerus.designState.calculationParameters.Draft_design
Gunnerus.structure.hull.attributes
Gunnerus.structure.hull.halfBreadths.waterlines[i]
Gunnerus.structure.hull.halfBreadths.stations[i]
Gunnerus.structure.hull.halfBreadths.table[i]
[<< Introduction](../index) || Top || [Next >>](../chapter-2/index.html)
This table has been truncated from ${data.length} rows to ${limit}
Gunnerus.structure.decks
Gunnerus.structure.bulkheads
zfloor
thickness
xAft
xFwd
yCentre
breadth
density
[<< Previous](../chapter-2/index.html) || Top || [Next >>](../section-2-2/index.html)
[<< Previous](../section-2-2/index.html) || Top || [Next >>](../section-3-1/index.html)
[<< Previous](../section-3-2/index.html) || Top || [Next >>](../section-4-1/index.html)
Gunnerus.baseObjects
Gunnerus.derivedObjects
xCentre
zBase
length
height
[<< Previous](../chapter-2/index.html) || Top || [Next >>](../section-2-3/index.html)
8.No6.sb.FO.#20-A.settl
[<< Previous](../section-2-2/index.html) || Top || [Next >>](../section-2-4/index.html)
Gunnerus
Ship3D
derivedObjects
baseObject
[<< Previous](../section-2-3/index.html) || Top || [Next >>](../section-2-5/index.html)
[<< Previous](../section-2-4/index.html) || Top || [Next >>](../section-2-6/index.html?collection=@ferrari212/from-hull-to-simulation)
boatPath