/** Copyright (C) 2020-2025 Kedron Holdings LLC, All Rights Reserved. This file is part of Reactor.
 *  For info and license terms please see https://reactor.toggledbits.com/
 *  ------------------------------------------------------------------------------
*/
const a12_0x2052ce = a12_0x4cca;
function a12_0x4cca(_0x5406f3, _0x40700c) {
    const _0x459f0c = a12_0x459f();
    return a12_0x4cca = function (_0x4ccadd, _0xcb4d89) {
        _0x4ccadd = _0x4ccadd - 0x87;
        let _0x16f74c = _0x459f0c[_0x4ccadd];
        return _0x16f74c;
    }, a12_0x4cca(_0x5406f3, _0x40700c);
}
(function (_0x4463a7, _0x3dab4f) {
    const _0x3c115c = a12_0x4cca, _0x471171 = _0x4463a7();
    while (!![]) {
        try {
            const _0x16797b = -parseInt(_0x3c115c(0xa8)) / 0x1 * (-parseInt(_0x3c115c(0x88)) / 0x2) + parseInt(_0x3c115c(0xa1)) / 0x3 + parseInt(_0x3c115c(0x94)) / 0x4 + parseInt(_0x3c115c(0x95)) / 0x5 + -parseInt(_0x3c115c(0x9d)) / 0x6 + parseInt(_0x3c115c(0x90)) / 0x7 * (-parseInt(_0x3c115c(0xa2)) / 0x8) + -parseInt(_0x3c115c(0x98)) / 0x9 * (parseInt(_0x3c115c(0x9e)) / 0xa);
            if (_0x16797b === _0x3dab4f)
                break;
            else
                _0x471171['push'](_0x471171['shift']());
        } catch (_0x2f792d) {
            _0x471171['push'](_0x471171['shift']());
        }
    }
}(a12_0x459f, 0x43b4b));
const version = 0x6235, Logger = require(a12_0x2052ce(0x8e)), Observable = require(a12_0x2052ce(0x8f)), Observer = require('./Observer.js'), util = require(a12_0x2052ce(0x8c));
var expressions = {};
const validName = /^\p{Alphabetic}[\p{Alphabetic}0-9_$]*$/iu;
function a12_0x459f() {
    const _0x2cadb5 = [
        'constructor',
        '58492GXlkRS',
        'name',
        '_destroy',
        'add',
        './util',
        'mixin',
        './Logger.js',
        './Observable.js',
        '3478181OsXwkM',
        'getValue',
        'setValue',
        'get',
        '761032nwhLFk',
        '143890mLwjyp',
        'has',
        'getLogger',
        '927voQrXe',
        'Expression\x20name\x20\x22',
        '%1:\x20Expression._destroy',
        'test',
        '\x22\x20is\x20invalid',
        '2381046hkXzVO',
        '4030bopDna',
        'Expression\x20named\x20\x22',
        'log',
        '1401276ZoqDfT',
        '8pNCVFd',
        'Needs\x20subclass\x20implementation',
        'debug',
        '__deleted',
        'getID',
        'unsubscribe',
        '18RlTRoI'
    ];
    a12_0x459f = function () {
        return _0x2cadb5;
    };
    return a12_0x459f();
}
class Expression {
    constructor(_0x2f0993) {
        const _0xc6b956 = a12_0x2052ce;
        this['id'] = _0x2f0993, this['log'] = Logger[_0xc6b956(0x97)](this);
    }
    static ['isValidName'](_0x56f252) {
        const _0xecc615 = a12_0x2052ce;
        return validName[_0xecc615(0x9b)](_0x56f252);
    }
    static [a12_0x2052ce(0x96)](_0x532572) {
        return !!expressions[_0x532572];
    }
    static [a12_0x2052ce(0x8b)](_0x1129eb) {
        const _0x1ae004 = a12_0x2052ce;
        let _0x3ad29a = _0x1129eb[_0x1ae004(0xa6)]();
        if (!Expression['isValidName'](_0x3ad29a))
            throw new Error(_0x1ae004(0x99) + _0x3ad29a + _0x1ae004(0x9c));
        if (expressions[_0x3ad29a])
            throw new Error(_0x1ae004(0x9f) + _0x3ad29a + '\x22\x20already\x20exists.');
        return expressions[_0x3ad29a] = _0x1129eb, _0x1129eb;
    }
    static [a12_0x2052ce(0x93)](_0x5d23c1) {
        return expressions[_0x5d23c1];
    }
    ['toString']() {
        const _0x1a42e0 = a12_0x2052ce;
        return this[_0x1a42e0(0x87)][_0x1a42e0(0x89)] + '#' + String(this['id']);
    }
    [a12_0x2052ce(0x8a)]() {
        const _0x9462d = a12_0x2052ce;
        this[_0x9462d(0xa0)][_0x9462d(0xa4)](0x5, _0x9462d(0x9a), this), this['id'] && (this[_0x9462d(0xa7)](), this['disconnect'](), delete expressions[this['id']], this[_0x9462d(0xa5)] = this['id'], this['id'] = null);
    }
    [a12_0x2052ce(0xa6)]() {
        return this['id'];
    }
    [a12_0x2052ce(0x91)]() {
        const _0x2f939b = a12_0x2052ce;
        throw new ReferenceError(_0x2f939b(0xa3));
    }
    [a12_0x2052ce(0x92)]() {
        const _0x5e2501 = a12_0x2052ce;
        throw new ReferenceError(_0x5e2501(0xa3));
    }
}
util[a12_0x2052ce(0x8d)](Expression, Observer), util[a12_0x2052ce(0x8d)](Expression, Observable), module['exports'] = Expression;