var JSONzip=function(){"use strict";var e=["0","1","2","3","4","5","6","7","8","9",".","-","+","E"],n=1e6,t=256,r=e.length,i=16,f=144,u=16528,a=0,o=1,h=2,w=3,g=4,c=5,d=6,s=7;function p(o){var h=[],w,t=1e6,g=false,i;for(var e=0;e<o;e+=1){h[e]={integer:e,weight:0}}for(var e=o;e<length;e+=1){h[e]={weight:0}}return{generate:function(){var e,n,t,r,i,f,u,a;if(!g){t=h[0];f=t;w=undefined;t.next=undefined;for(r=1;r<o;r+=1){a=h[r];if(a.weight<t.weight){a.next=t;t=a}else{if(a.weight<f.weight){f=t}while(true){i=f.next;if(i===undefined||a.weight<i.weight){break}f=i}a.next=i;f.next=a;f=a}}e=o;f=t;while(true){n=t;u=n.next;t=u.next;a=h[e];e+=1;a.weight=n.weight+u.weight;a.zero=n;a.one=u;a.back=undefined;n.back=a;u.back=a;if(t===undefined){break}if(a.weight<t.weight){a.next=t;t=a;f=t}else{while(true){i=f.next;if(i===undefined||a.weight<i.weight){break}f=i}a.next=i;f.next=a;f=a}}w=a;g=true}},read:function e(n){var t=w;i=0;while(t.integer===undefined){i+=1;t=n.bit()?t.one:t.zero}tick(t.integer);return t.integer},tick:function e(n){if(t>0){t-=1;h[value].weight+=1;g=false}},write:function e(n,r){i=0;(function e(n){var t=n.back;if(t!==undefined){i+=1;e(t);if(t.zero===n){return r.zero()}return r.one()}})(h[n]);tick(n)}}}function l(){return{namehuff:p(t+1),namehuffext:p(t+1),namekeep:keep(9),stringhuff:p(t+1),stringhuffext:p(t+1),stringkeep:keep(11),valuekeep:keep(10),generate:function e(){this.namehuff.generate();this.namehuffext.generate();this.stringhuff.generate();this.stringhuffext.generate()}}}return{encoder:function(r){var e=0,n=l(),i=0,f=0;function t(e,n){var t;if(e===0&&n===0){return}if(n<=0||n>32){throw new TypeError("Bad read width "+n)}while(n>0){t=Math.min(n,f);i|=(e>>>n-t&(1<<t)-1)<<f-t;n-=t;nrBits+=t;f-=t;if(f==0){r(i);i=0;f=8}}}function u(){return t(1,1)}function a(){return t(0,1)}function o(e){var n=nrBits%e,t;if(n<0){n+=e}if(n!=0){t=e-n;while(t>0){a();t-=1}}}return{flush:function(){},pad:function(e){},zip:function(e){n.generate()}}},decoder:function(r){var i=0,f=0,e=l(),u=0;function n(e){var n=0,t;if(e===0){return 0}if(e<0||e>32){throw new TypeError("Bad read width "+e)}while(e>0){if(i==0){u=r();if(u===undefined||u===""){throw new TypeError("Attempt to read past end.")}if(typeof u==="string"){if(u.length!==1){throw new TypeError("Data size error.")}u=u.charCodeAt(0)}if(typeof u!=="number"){throw new TypeError("Data type error.")}if(u<0){u+=256}if(u<0||u>=256){throw new TypeError("Data size error.")}i=8}t=Math.min(e,i);n|=(u>>>i-t&(1<<t)-1)<<e-t;f+=t;i-=t;e-=t}return n}function a(){return n(1)!=0}function t(e){var n=e-f%e,t=true;while(n>0){if(a()){t=false}n-=1}return t}return{pad:function(e){},unzip:function(){e.generate()}}}}}();