var ilib=require("./ilib.js");var JSUtils=require("./JSUtils.js");var Charset=require("./Charset.js");var Charmap=require("./Charmap.js");var CharmapFactory=function(options){var charsetName=options&&options.name||"ISO-8859-15";var sync=true;if(options){if(typeof options.sync==="boolean"){sync=options.sync}}var instance;new Charset({name:charsetName,sync:sync,loadParams:options&&options.loadParams,onLoad:function(charset){var cons,name=charset.getName();if(!Charmap._algorithms[name]&&ilib.isDynCode()){var entry=CharmapFactory._dynMap[name]||"CharmapTable";cons=Charmap._algorithms[name]=require("./"+entry+".js")}if(!cons){cons=Charmap._algorithms[name]||Charmap._algorithms["CharmapTable"]}instance=cons&&new cons(JSUtils.merge(options||{},{charset:charset}))}});return instance};CharmapFactory._dynMap={"UTF-8":"UTF8","UTF-16":"UTF16LE","UTF-16LE":"UTF16LE","UTF-16BE":"UTF16BE","US-ASCII":"Charmap"};module.exports=CharmapFactory;