(function(l){function o(e){return e instanceof ErlBinary?String.fromCharCode.apply(String,e.value):e}function f(e){return e instanceof ErlAtom?e.value:e}function a(e,n){return e!=="phx_reply"?n:{status:f(n.status),response:n.response}}var i={encode:function(e,n){var r=[e.join_ref,e.ref,e.topic,e.event,Flick.map(e.payload||{})];return n(Flick.encode(r))},decode:function(e,n){var r=Flick.decode(e),t=o(r[3]);return n({join_ref:o(r[0]),ref:o(r[1]),topic:o(r[2]),event:t,payload:a(t,r[4])})}};typeof module<"u"&&module.exports&&(module.exports=i),l.FlickChannelSerializer=i})(typeof window<"u"?window:globalThis);