<commit_before>
import { LEG_CAVE } from '../core/constants';
import { Cfg } from '../core/lib';
import { PopupMaterial } from '../materials/PopupMaterial';

import {
	CanvasTexture,
	BufferGeometry,
	Float32BufferAttribute,
	Uint16BufferAttribute,
	Mesh
} from '../../../../three.js/src/Three';


function PopupGeometry () {

	BufferGeometry.call( this );

	this.type = 'PopupGeometry';

	const indexAttribute = new Uint16BufferAttribute( [ 0, 2, 1, 0, 3, 2 ], 1 );

	// unit square
	const positions = [
		0, 0, 0,
		0, 1, 0,
		1, 1, 0,
		1, 0, 0
	];

	const positionAttribute = new Float32BufferAttribute( positions, 3 );

	this.setIndex( indexAttribute );
	this.addAttribute( 'position', positionAttribute );

}

PopupGeometry.prototype = Object.create( BufferGeometry.prototype );

function Popup() {

	Mesh.call( this, new PopupGeometry() );

	this.lines = [];
	this.layers.set( LEG_CAVE );
	this.type = 'Popup';

	return this;

}

Popup.prototype = Object.create( Mesh.prototype );

Popup.prototype.constructor = Popup;

Popup.prototype.addLine = function ( line ) {

	this.lines.push( line );
<commit_msg>render popup last<commit_after>
import { LEG_CAVE } from '../core/constants';
import { Cfg } from '../core/lib';
import { PopupMaterial } from '../materials/PopupMaterial';

import {
	CanvasTexture,
	BufferGeometry,
	Float32BufferAttribute,
	Uint16BufferAttribute,
	Mesh
} from '../../../../three.js/src/Three';


function PopupGeometry () {

	BufferGeometry.call( this );

	this.type = 'PopupGeometry';

	const indexAttribute = new Uint16BufferAttribute( [ 0, 2, 1, 0, 3, 2 ], 1 );

	// unit square
	const positions = [
		0, 0, 0,
		0, 1, 0,
		1, 1, 0,
		1, 0, 0
	];

	const positionAttribute = new Float32BufferAttribute( positions, 3 );

	this.setIndex( indexAttribute );
	this.addAttribute( 'position', positionAttribute );

}

PopupGeometry.prototype = Object.create( BufferGeometry.prototype );

function Popup() {

	Mesh.call( this, new PopupGeometry() );

	this.lines = [];
	this.layers.set( LEG_CAVE );
	this.type = 'Popup';
	this.renderOrder = Infinity;

	return this;

}

Popup.prototype = Object.create( Mesh.prototype );

Popup.prototype.constructor = Popup;

Popup.prototype.addLine = function ( line ) {

	this.lines.push( line );

{'fraction_non_alphanumeric': 0.15013286093888398, 'fraction_numerical': 0.024800708591674048, 'mean_word_length': 3.8063829787234043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2722167', 'n_tokens_mistral': 808, 'n_tokens_neox': 752, 'n_words': 186}