const{c:e}=require("hyperschema/runtime"),n=1;let t=1;const d={preencode(n,t){n.end++,t.timestamp&&e.uint.preencode(n,t.timestamp),t.length&&e.uint.preencode(n,t.length)},encode(n,t){const d=(t.timestamp?1:0)|(t.length?2:0);e.uint.encode(n,d),t.timestamp&&e.uint.encode(n,t.timestamp),t.length&&e.uint.encode(n,t.length)},decode(n){const t=e.uint.decode(n);return{timestamp:1&t?e.uint.decode(n):0,length:2&t?e.uint.decode(n):0}}},o={preencode(n,t){n.end++,t.updated&&e.uint.preencode(n,t.updated)},encode(n,t){const d=t.updated?1:0;e.uint.encode(n,d),t.updated&&e.uint.encode(n,t.updated)},decode:n=>({updated:1&e.uint.decode(n)?e.uint.decode(n):0})};function c(e){t=e}function u(n,d,o=1){return t=o,e.encode(s(n),d)}function r(n,d,o=1){return t=o,e.decode(s(n),d)}function i(e){throw new Error("Enum not found "+e)}function s(e){switch(e){case"@keet-unreads/unread-anchors":return d;case"@keet-unreads/info":return o;default:throw new Error("Encoder not found "+e)}}function p(e,n=1){const d=s(e);return{preencode(e,o){t=n,d.preencode(e,o)},encode(e,o){t=n,d.encode(e,o)},decode:e=>(t=n,d.decode(e))}}const a=p;module.exports={resolveStruct:a,getStruct:p,getEnum:i,getEncoding:s,encode:u,decode:r,setVersion:c,version:t};