
class Tables:
    def __init__(self, data: dict):
        self.data = data

    def any(self, table, **kwds)->dict:
        pass

    def get(self, table, _default, **kwds)->dict:
        for row in self.data:
            match = True
            for k, v in kwds.items():
                if k not in row or row[k] != v:
                    match = False
                    break

            if match:
                return row

    def all(self, table, **kwds)->list:
        rows = []
        for row in table:
            match = True
            for k, v in kwds.items():
                if k not in row or row[k] != v:
                    match = False
                    break

            if match:
                rows.append(row)

        return rows


_Tables = {
    "General": {
        "ACTIVE DEGREES OF FREEDOM",
        "ANALYSIS OPTIONS",
        "PROGRAM CONTROL",
        "PROJECT INFORMATION",
        "REBAR SIZES",
    },

    "Options": {
        "OPTIONS - COLORS - DISPLAY",
        "OPTIONS - COLORS - OUTPUT",
        "TABLES AUTOMATICALLY SAVED AFTER ANALYSIS",
    },

    "Connectivity": {
        "CONNECTIVITY - AREA",
        "CONNECTIVITY - CABLE",
        "CONNECTIVITY - FRAME",
        "CONNECTIVITY - LINK",
        "CONNECTIVITY - SOLID",
        "CONNECTIVITY - TENDON",
    },

    "Loads": {
        "LOAD CASE DEFINITIONS",
        "LOAD PATTERN DEFINITIONS",
        "MASS SOURCE",
        "LINK LOADS - GRAVITY",
        "JOINT LOADS - FORCE",
        "JOINT LOADS - GROUND DISPLACEMENT",

        "FRAME LOADS - DISTRIBUTED",
        "FRAME LOADS - GRAVITY",
        "FRAME LOADS - POINT",
        "FRAME LOADS - TEMPERATURE",
        "CABLE LOADS - DISTRIBUTED",
        "CABLE LOADS - TEMPERATURE",

        "SOLID LOADS - GRAVITY",
        "SOLID LOADS - PORE PRESSURE",
        "SOLID LOADS - SURFACE PRESSURE",
        "SOLID LOADS - TEMPERATURE",

        "AREA LOADS - GRAVITY",
        "AREA LOADS - PORE PRESSURE",
        "AREA LOADS - ROTATE",
        "AREA LOADS - SURFACE PRESSURE",
        "AREA LOADS - TEMPERATURE",
        "AREA LOADS - UNIFORM",

        "TENDON LOADS - TENSION FORCE OR STRESS",
    },

    "Material": {
        "MATERIAL PROPERTIES 01 - GENERAL",
        "MATERIAL PROPERTIES 02 - BASIC MECHANICAL PROPERTIES",

        "MATERIAL PROPERTIES 03A - STEEL DATA",
        "MATERIAL PROPERTIES 03B - CONCRETE DATA",
        "MATERIAL PROPERTIES 03C - ALUMINUM DATA",
        "MATERIAL PROPERTIES 03D - COLD FORMED DATA",
        "MATERIAL PROPERTIES 03E - REBAR DATA",
        "MATERIAL PROPERTIES 03F - TENDON DATA",
        "MATERIAL PROPERTIES 03G - OTHER DATA",
        "MATERIAL PROPERTIES 03J - COUPLED NONLINEAR VON MISES DATA",

        "MATERIAL PROPERTIES 04 - USER STRESS-STRAIN CURVES",
        "MATERIAL PROPERTIES 06 - DAMPING PARAMETERS",
        "MATERIAL PROPERTIES 09 - ACCEPTANCE CRITERIA",
    },

    "Joint": {
        "JOINT ADDED MASS ASSIGNMENTS",
        "JOINT ADDED MASS BY VOLUME ASSIGNMENTS",
        "JOINT BRIDGE OBJECT FLAGS",
        "JOINT CONSTRAINT ASSIGNMENTS",
        "JOINT COORDINATES",
        "JOINT LOCAL AXES ASSIGNMENTS 1 - TYPICAL",
        "JOINT MERGE NUMBER ASSIGNMENTS",
        "JOINT PATTERN ASSIGNMENTS",
        "JOINT PATTERN DEFINITIONS",
        "JOINT RESTRAINT ASSIGNMENTS",
        "JOINT SPRING ASSIGNMENTS 1 - UNCOUPLED",
        "JOINT VEHICLE RESPONSE COMPONENT OVERWRITES",
    },

    "Point": {
        "LINK BRIDGE OBJECT FLAGS",
        "LINK FREQUENCY DEPENDENT PROPERTIES 01 - GENERAL",
        "LINK FREQUENCY DEPENDENT PROPERTIES 02 - DETAILS",
        "LINK LOCAL AXES ASSIGNMENTS 1 - TYPICAL",
        "LINK LOCAL AXES ASSIGNMENTS 2 - ADVANCED",
        "LINK PROPERTY ASSIGNMENTS",
        "LINK PROPERTY DEFINITIONS - BRIDGE OBJECT FLAGS",
        "LINK PROPERTY DEFINITIONS 01 - GENERAL",
        "LINK PROPERTY DEFINITIONS 02 - LINEAR",
        "LINK PROPERTY DEFINITIONS 03 - MULTILINEAR",
        "LINK PROPERTY DEFINITIONS 04 - DAMPER",
        "LINK PROPERTY DEFINITIONS 05 - GAP",
        "LINK PROPERTY DEFINITIONS 06 - HOOK",
        "LINK PROPERTY DEFINITIONS 07 - RUBBER ISOLATOR",
        "LINK PROPERTY DEFINITIONS 08 - SLIDING ISOLATOR",
        "LINK PROPERTY DEFINITIONS 10 - PLASTIC (WEN)",
        "LINK PROPERTY DEFINITIONS 11 - MULTILINEAR PLASTIC",
        "LINK VEHICLE RESPONSE COMPONENT OVERWRITES",
    },

    "Frame": {
        "FRAME ADDED MASS ASSIGNMENTS",
        "FRAME AUTO MESH ASSIGNMENTS",
        "FRAME BRIDGE OBJECT FLAGS",
        "FRAME DESIGN PROCEDURES",
        "FRAME INSERTION POINT ASSIGNMENTS",
        "FRAME JOINT OFFSETS - BRIDGE OBJECT FLAGS",
        "FRAME LOCAL AXES ASSIGNMENTS 1 - TYPICAL",
        
        "FRAME P-DELTA FORCE ASSIGNMENTS",
        "FRAME PROPERTY MODIFIERS",
        "FRAME SPRING ASSIGNMENTS",

        # Hinges and releases
        "FRAME HINGE ASSIGNS 00 - HINGE DISTRIBUTION TYPE",
        "FRAME HINGE ASSIGNS 02 - USER DEFINED PROPERTIES",
        "FRAME HINGE ASSIGNS 09 - HINGE OVERWRITES",
        "FRAME RELEASE ASSIGNMENTS 1 - GENERAL",
        "FRAME RELEASE ASSIGNMENTS 2 - PARTIAL FIXITY",

        "FRAME LOAD TRANSFER OPTIONS",
        
        "FRAME OFFSET ALONG LENGTH ASSIGNMENTS",
        "FRAME OUTPUT STATION ASSIGNMENTS",
        "FRAME TENSION AND COMPRESSION LIMITS",
        "FRAME VEHICLE RESPONSE COMPONENT OVERWRITES",
        "FRAME SECTION ASSIGNMENTS",

        "FRAME SECTION PROPERTIES - BRIDGE OBJECT FLAGS",
        "FRAME SECTION PROPERTIES 01 - GENERAL",
        "FRAME SECTION PROPERTIES 02 - CONCRETE COLUMN",
        "FRAME SECTION PROPERTIES 05 - NONPRISMATIC",
        "FRAME SECTION PROPERTIES 06 - POLYGON DATA",
        "FRAME SECTION PROPERTIES 13 - TIME DEPENDENT",
    },

    "Shell": {
        "AREA LOCAL AXES ASSIGNMENTS 1 - TYPICAL",
        "AREA LOCAL AXES ASSIGNMENTS 2 - ADVANCED",
        "AREA ADDED MASS ASSIGNMENTS",

        "AREA AUTO MESH ASSIGNMENTS",
        "AREA BRIDGE OBJECT FLAGS",
        "AREA EDGE CONSTRAINT ASSIGNMENTS",

        "AREA OVERWRITES - JOINT OFFSETS",
        "AREA OVERWRITES - THICKNESS",

        "AREA SECTION ASSIGNMENTS",
        "AREA SECTION PROPERTIES - BRIDGE OBJECT FLAGS",
        "AREA SECTION PROPERTIES",
        "AREA SECTION PROPERTY - TIME DEPENDENT",
        "AREA SECTION PROPERTY DESIGN PARAMETERS",
        "AREA SPRING ASSIGNMENTS",
        "AREA STIFFNESS MODIFIERS",
    },

    "Solid": {
        "SOLID AUTO MESH ASSIGNMENTS",
        "SOLID LOCAL AXES ASSIGNMENTS 1 - TYPICAL",
        "SOLID PROPERTY ASSIGNMENTS",
        "SOLID PROPERTY DEFINITIONS",
        "SOLID SPRING ASSIGNMENTS",
    },

    "Cable": {
        "CABLE OUTPUT STATION ASSIGNMENTS",
        "CABLE SECTION ASSIGNMENTS",
        "CABLE SECTION DEFINITIONS",
        "CABLE SHAPE DATA",
    },
    "Bridge": {
        "BRIDGE ABUTMENT DEFINITIONS",
        "BRIDGE BEARING DEFINITIONS",
        "BRIDGE BENT DEFINITIONS 1 - GENERAL",
        "BRIDGE BENT DEFINITIONS 2 - COLUMN DATA",
        "BRIDGE DESIGN PREFERENCES - AASHTO LRFD 2020",
        "BRIDGE DESREQSUPER 01 - GENERAL",
        "BRIDGE DESREQSUPER 02 - STATION RANGES",
        "BRIDGE DESREQSUPER 03 - DEMAND SETS",
        "BRIDGE DESREQSUPER 04 - LLDF - AASHTOLRFD20",
        "BRIDGE DESREQSUPER 05 - PARAM - ALL CODES - CBOXTENDON",
        "BRIDGE DESREQSUPER 09 - PARAM - AASHTOLRFD20 - CBOX2STRESS",
        "BRIDGE DESREQSUPER 10 - PARAM - AASHTOLRFD20 - CBOX2SHEAR",
        "BRIDGE DESREQSUPER 11 - PARAM - AASHTOLRFD20 - CBOX2FLEXURE",
        "BRIDGE DIAPHRAGM DEFINITIONS",
        "BRIDGE ERECTION DEFINITION 01 - TRAVELER",
        "BRIDGE GROUP DEFINITION 01 - GENERAL",
        "BRIDGE GROUP DEFINITION 02 - SECTION",
        "BRIDGE GROUP DEFINITION 08 - SUPPORT STRUCTURE",
        "BRIDGE GROUP DEFINITION 09 - BEARING - SUPPORT",
        "BRIDGE GROUP DEFINITION 14 - MIXED",
        "BRIDGE LAYOUT LINE 1 - GENERAL",
        "BRIDGE LAYOUT LINE 2 - HORIZONTAL LAYOUT DATA",
        "BRIDGE LAYOUT LINE 3 - VERTICAL LAYOUT DATA",
        "BRIDGE LOAD DEFINITIONS 02 - LINE",
        "BRIDGE LOAD DEFINITIONS 03 - AREA",
        "BRIDGE OBJECT DEFINITIONS 01 - GENERAL",
        "BRIDGE OBJECT DEFINITIONS 02 - REFERENCE LINE",
        "BRIDGE OBJECT DEFINITIONS 03 - SPANS 1 - GENERAL",
        "BRIDGE OBJECT DEFINITIONS 06 - ABUTMENTS",
        "BRIDGE OBJECT DEFINITIONS 07 - BENTS",
        "BRIDGE OBJECT DEFINITIONS 09 - SUPER ELEVATION 1 - GENERAL",
        "BRIDGE OBJECT DEFINITIONS 11 - PRESTRESS 1 - GENERAL",
        "BRIDGE OBJECT DEFINITIONS 12 - PRESTRESS 2 - VERTICAL LAYOUT",
        "BRIDGE OBJECT DEFINITIONS 13 - PRESTRESS 3 - HORIZONTAL LAYOUT",
        "BRIDGE OBJECT DEFINITIONS 14 - DIAPHRAGMS",
        "BRIDGE OBJECT DEFINITIONS 15 - UPDATE DATA",
        "BRIDGE OBJECT DEFINITIONS 21 - TEMPERATURE LOADS",
        "BRIDGE OBJECT DEFINITIONS 26 - LINE LOADS",
        "BRIDGE OBJECT DEFINITIONS 27 - AREA LOADS",
        "BRIDGE OBJECT DEFINITIONS 28 - SPAN SEGMENTS",
        "BRIDGE OBJECT DEFINITIONS 31 - WIND LOADS",
        "BRIDGE OBJECT DEFINITIONS 32 - WIND LOAD - LOADPATTERN LIST",
        "BRIDGE PREFERENCES",
        "BRIDGE RATEREQSUPER 01 - GENERAL",
        "BRIDGE RATEREQSUPER 02 - STATION RANGES",
        "BRIDGE RATEREQSUPER 03 - DEMAND SETS",
        "BRIDGE RATEREQSUPER 07 - PARAM - AASHTORATE18 - CBOX2SHEAR",
        "BRIDGE RATEREQSUPER 08 - PARAM - AASHTORATE18 - CBOX2FLEXURE",
        "BRIDGE RATEREQSUPER 09 - PARAM - AASHTORATE18 - CBOX2MINREBAR",
        "BRIDGE RATEREQSUPER 20 - PARAM - AASHTORATE18 - CBOX2SERV",
        "BRIDGE RATING PREFERENCES - AASHTO RATING 2018",
        "BRIDGE RESPONSE",
        "BRIDGE SECTION CUTS 01 - GENERAL",
        "BRIDGE SECTION CUTS 02 - GROUPS",
        "BRIDGE SECTION CUTS 03 - STRESS POINTS",
        "BRIDGE SECTION CUTS 04 - GIRDER DATA - GENERAL",
        "BRIDGE SECTION CUTS 05 - GIRDER DATA - GROUPS",
        "BRIDGE SECTION DEFINITIONS - GIRDER OUTPUT LOCATION DATA",
        "BRIDGE SECTION DEFINITIONS 02 - CONCRETE BOX GIRDER",
        "BRIDGE SECTION LOAD DEFINITIONS 05 - BARRIER",
        "BRIDGE SECTION LOAD DEFINITIONS 07 - WEARING SURFACE",
        "BRIDGE SECTION LOAD DEFINITIONS 08 - TEMPERATURE CHANGE",
        "BRIDGE SEISMIC DESIGN PREFERENCES - AASHTO SEISMIC 2011",
    },
    "Other": {
        "AUTO WAVE 3 - WAVE CHARACTERISTICS - GENERAL",
        "AUTO WIND - AASHTO 2020",
        "AUTO WIND - LIVE LOAD",
        "AUTO WIND ANGLES",
        "AUTO WIND EXPOSURE FOR HORIZONTAL DIAPHRAGMS",


        "CASE - BUCKLING 1 - GENERAL",
        "CASE - BUCKLING 2 - LOAD ASSIGNMENTS",
        "CASE - DIRECT HISTORY 1 - GENERAL",
        "CASE - DIRECT HISTORY 2 - LOAD ASSIGNMENTS",
        "CASE - DIRECT HISTORY 3 - VISCOUS PROPORTIONAL DAMPING",
        "CASE - DIRECT HISTORY 4 - INTEGRATION PARAMETERS",
        "CASE - DIRECT HISTORY 5 - NONLINEAR PARAMETERS",
        "CASE - DIRECT HISTORY 6 - MODAL PROPORTIONAL DAMPING",
        "CASE - MODAL 1 - GENERAL",
        "CASE - MODAL 3 - LOAD ASSIGNMENTS - RITZ",
        "CASE - MODAL HISTORY 1 - GENERAL",
        "CASE - MODAL HISTORY 2 - LOAD ASSIGNMENTS",
        "CASE - MODAL HISTORY 4 - PROPORTIONAL DAMPING",
        "CASE - MODAL HISTORY 5 - DAMPING OVERRIDES",
        "CASE - MODAL HISTORY 6 - NONLINEAR PARAMETERS",
        "CASE - MOVING LOAD 1 - LANE ASSIGNMENTS",
        "CASE - MOVING LOAD 2 - LANES LOADED",
        "CASE - MOVING LOAD 3 - MULTILANE FACTORS",
        "CASE - MULTISTEP STATIC 1 - LOAD ASSIGNMENTS",
        "CASE - RESPONSE SPECTRUM 1 - GENERAL",
        "CASE - RESPONSE SPECTRUM 2 - LOAD ASSIGNMENTS",
        
        "CASE - STATIC 1 - LOAD ASSIGNMENTS",
        "CASE - STATIC 2 - NONLINEAR LOAD APPLICATION",
        "CASE - STATIC 4 - NONLINEAR PARAMETERS",
        "CASE - STATIC 5 - NONLINEAR STAGE DEFINITIONS",
        "CASE - STATIC 6 - NONLINEAR STAGE DATA",

        "CASE - STEADY STATE 1 - GENERAL",
        "CASE - STEADY STATE 2 - LOAD ASSIGNMENTS",
        "CASE - STEADY STATE 3 - ADDED FREQUENCIES GENERAL",
        "CASE - STEADY STATE 5 - ADDED SPECIFIED FREQUENCIES",
        "CASE - STEADY STATE 6 - CONSTANT DAMPING",
        "COMBINATION DEFINITIONS",

        "CONSTRAINT DEFINITIONS - BODY",
        "CONSTRAINT DEFINITIONS - BRIDGE OBJECT FLAGS",
        "CONSTRAINT DEFINITIONS - DIAPHRAGM",
        "CONSTRAINT DEFINITIONS - EQUAL",
        "CONSTRAINT DEFINITIONS - ROD",
        "COORDINATE SYSTEMS",
        "DATABASE DOCUMENTATION",
        "DATABASE FORMAT TYPES",
        "FLOATING LANE DEFINITION DATA",

        "FUNCTION - PLOT FUNCTIONS",
        "FUNCTION - POWER SPECTRAL DENSITY - USER",
        "FUNCTION - RESPONSE SPECTRUM - AASHTO 2007",
        "FUNCTION - RESPONSE SPECTRUM - USER",
        "FUNCTION - STEADY STATE - USER",
        "FUNCTION - TIME HISTORY - FROM FILE",
        "FUNCTION - TIME HISTORY - RAMP",
        "FUNCTION - TIME HISTORY - SINE",
        "FUNCTION - TIME HISTORY - USER",

        "GENERALIZED DISPLACEMENT DEFINITIONS 1 - TRANSLATIONAL",
        "GENERALIZED DISPLACEMENT DEFINITIONS 2 - ROTATIONAL",
        "GRID LINES",

        "GROUPS 1 - DEFINITIONS",
        "GROUPS 2 - ASSIGNMENTS",
        "GROUPS 4 - BRIDGE OBJECT FLAGS",

        "HINGES DEF 02 - NONINTERACTING - DEFORM CONTROL - GENERAL",
        "HINGES DEF 03 - NONINTERACTING - DEFORM CONTROL - FORCE-DEFORM",
        "HINGES DEF 04 - NONINTERACTING - DEFORM CONTROL - ACCEPTANCE",

        "LANE DEFINITION DATA",

        "NAMED SETS - DATABASE TABLES 1 - GENERAL",
        "NAMED SETS - DATABASE TABLES 2 - SELECTIONS",
        "OVERWRITES - CONCRETE DESIGN - ACI 318-08/IBC2009",
        "OVERWRITES - STEEL DESIGN - AISC360-05-IBC2006",

        "PREFERENCES - ALUMINUM DESIGN - AA 2015",
        "PREFERENCES - COLD FORMED DESIGN - AISI-16",
        "PREFERENCES - COLD FORMED DESIGN - AISI-ASD96",
        "PREFERENCES - CONCRETE DESIGN - AASHTO LRFD 2014",
        "PREFERENCES - CONCRETE DESIGN - ACI 318-08/IBC2009",
        "PREFERENCES - CONCRETE SHELL DESIGN - EUROCODE 2-2004",
        "PREFERENCES - DIMENSIONAL",
        "PREFERENCES - STEEL DESIGN - AASHTO-LRFD-2020",
        "PREFERENCES - STEEL DESIGN - AISC360-05-IBC2006",

        "SECTION CUTS 1 - GENERAL",

        "TENDON BRIDGE OBJECT FLAGS",
        "TENDON LAYOUT DATA 01 - GENERAL",
        "TENDON LAYOUT DATA 02 - SEGMENTS",
        "TENDON SECTION ASSIGNMENTS",
        "TENDON SECTION DEFINITIONS - BRIDGE OBJECT FLAGS",
        "TENDON SECTION DEFINITIONS",

        "VEHICLES 2 - GENERAL VEHICLES 1 - GENERAL",
        "VEHICLES 3 - GENERAL VEHICLES 2 - LOADS",
        "VEHICLES 4 - VEHICLE CLASSES",
    }
}
