-- Penlight 1.11.0-1 | /lua/pl/Map.lua | https://github.com/lunarmodules/Penlight | License: MIT | Minified using https://www.npmjs.com/package/luamin/v/1.0.4
-- Copyright (C) 2009-2016 Steve Donovan, David Manura.
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
local a=require'pl.tablex'local b=require'pl.utils'local c=b.stdmt;local d=a.deepcompare;local e=require'pl.pretty'.write;local f=c.Map;local g=c.Set;local h=require'pl.class'h(nil,nil,f)function f:_init(i)local j=getmetatable(i)if j==g or j==f then self:update(i)else return i end end;local function k(i)return setmetatable(i,require('pl.List'))end;f.keys=a.keys;f.values=a.values;function f:iter()return pairs(self)end;function f:items()local l=k(a.pairmap(function(m,n)return k{m,n}end,self))l:sort(function(o,p)return o[1]<p[1]end)return l end;function f:setdefault(q,r)local s=self[q]if s~=nil then return s end;self:set(q,r)return r end;f.len=a.size;function f:set(q,s)self[q]=s end;function f:get(q)return rawget(self,q)end;local t=a.index_by;function f:getvalues(u)return k(t(self,u))end;f.update=a.update;function f:__eq(v)return d(self,v,true)end;function f:__tostring()return e(self,'')end;return f
