local G=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local z=game:GetService("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101")local q=game:GetService("\082\117\110\083\101\114\118\105\099\101")local u=require(script.LegacyLoader)local t=require(script.StaticLegacyLoader)local P=require(script.LoaderUtils)local c,S if q:IsRunning()then c=u.new(script)S={__call=function(G,z)return c:Require(z)end,__index=function(G,z)return c:Require(z)end}else c=t.new()S={__call=function(G,z)local q=getfenv(2)return c:Require(q.script,z)end,__index=function(G,z)local q=getfenv(2)return c:Require(q.script,z)end}end
--[=[
	Loads Nevermore and handles loading!

	This is a centralized loader that handles the following scenarios:

	* Specific layouts for npm node_modules
	* Layouts for node_modules being symlinked
	* Multiple versions of modules being used in conjunction with each other
	* Relative path requires
	* Require by name
	* Replication to client and server

	@class Loader
]=]

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local RunService = game:GetService("RunService")

local LegacyLoader = require(script.LegacyLoader)
local StaticLegacyLoader = require(script.StaticLegacyLoader)
local LoaderUtils = require(script.LoaderUtils)

local loader, metatable
if RunService:IsRunning() then
	loader = LegacyLoader.new(script)
	metatable = {
		__call = function(_self, value)
			return loader:Require(value)
		end,
		__index = function(_self, key)
			return loader:Require(key)
		end,
	}
else
	loader = StaticLegacyLoader.new()
	metatable = {
		__call = function(_self, value)
			local env = getfenv(2)
			return loader:Require(env.script, value)
		end,
		__index = function(_self, key)
			local env = getfenv(2)
			return loader:Require(env.script, key)
		end,
	}
end
