// Compiled by ClojureScript 1.10.520 {}
goog.provide('weathergen.falcon.files');
goog.require('cljs.core');
goog.require('clojure.string');
goog.require('octet.core');
goog.require('taoensso.timbre');
goog.require('weathergen.util');
weathergen.falcon.files.all_errors = new cljs.core.Keyword(null,"default","default",-1987822328);
weathergen.falcon.files.read_trace = (function weathergen$falcon$files$read_trace(msg,spec){
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27578 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27578 = (function (msg,spec,meta27579){
this.msg = msg;
this.spec = spec;
this.meta27579 = meta27579;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27578.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_27580,meta27579__$1){
var self__ = this;
var _27580__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27578(self__.msg,self__.spec,meta27579__$1));
});

weathergen.falcon.files.t_weathergen$falcon$files27578.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_27580){
var self__ = this;
var _27580__$1 = this;
return self__.meta27579;
});

weathergen.falcon.files.t_weathergen$falcon$files27578.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27578.prototype.octet$spec$ISpec$read$arity$3 = (function (_,buf,pos){
var self__ = this;
var ___$1 = this;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.falcon.files",null,21,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (___$1){
return (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [["start: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.msg),"@",cljs.core.str.cljs$core$IFn$_invoke$arity$1(pos)].join('')], null);
});})(___$1))
,null)),null,965077640);

var result = octet.spec.read.call(null,self__.spec,buf,pos);
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.falcon.files",null,23,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (result,___$1){
return (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [["end: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(self__.msg)].join('')], null);
});})(result,___$1))
,null)),null,760062436);

try{var result__14869__auto__ = result;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.falcon.files",null,24,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (result__14869__auto__,result,___$1){
return (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"result","result",-1239343558,null),"=>",result__14869__auto__], null);
});})(result__14869__auto__,result,___$1))
,null)),null,1214500594);

return result__14869__auto__;
}catch (e27581){if((e27581 instanceof Error)){
var e__14831__auto__ = e27581;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"weathergen.falcon.files",null,24,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (e__14831__auto__,result,___$1){
return (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [e__14831__auto__], null);
});})(e__14831__auto__,result,___$1))
,null)),null,2061331116);

throw e__14831__auto__;
} else {
throw e27581;

}
}});

weathergen.falcon.files.t_weathergen$falcon$files27578.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"msg","msg",254428083,null),new cljs.core.Symbol(null,"spec","spec",1988051928,null),new cljs.core.Symbol(null,"meta27579","meta27579",66643556,null)], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27578.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27578.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27578";

weathergen.falcon.files.t_weathergen$falcon$files27578.cljs$lang$ctorPrWriter = (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27578");
});

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27578.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27578 = (function weathergen$falcon$files$read_trace_$___GT_t_weathergen$falcon$files27578(msg__$1,spec__$1,meta27579){
return (new weathergen.falcon.files.t_weathergen$falcon$files27578(msg__$1,spec__$1,meta27579));
});

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27578(msg,spec,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Length prefixed string
 */
weathergen.falcon.files.lstring = (function weathergen$falcon$files$lstring(length_spec){
var len_size = octet.core.size.call(null,length_spec);
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27582 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {cljs.core.IFn}
 * @implements {octet.spec.ISpecDynamicSize}
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27582 = (function (length_spec,len_size,meta27583){
this.length_spec = length_spec;
this.len_size = len_size;
this.meta27583 = meta27583;
this.cljs$lang$protocol_mask$partition0$ = 393217;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (len_size){
return (function (_27584,meta27583__$1){
var self__ = this;
var _27584__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27582(self__.length_spec,self__.len_size,meta27583__$1));
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (len_size){
return (function (_27584){
var self__ = this;
var _27584__$1 = this;
return self__.meta27583;
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.call = ((function (len_size){
return (function (self__){
var self__ = this;
var self____$1 = this;
var s = self____$1;
return s;
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.apply = ((function (len_size){
return (function (self__,args27585){
var self__ = this;
var self____$1 = this;
return self____$1.call.apply(self____$1,[self____$1].concat(cljs.core.aclone.call(null,args27585)));
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.cljs$core$IFn$_invoke$arity$0 = ((function (len_size){
return (function (){
var self__ = this;
var s = this;
return s;
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.octet$spec$ISpecDynamicSize$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.octet$spec$ISpecDynamicSize$size_STAR_$arity$2 = ((function (len_size){
return (function (_,data){
var self__ = this;
var ___$1 = this;
var data__$1 = octet.spec.string.string__GT_bytes.call(null,data);
return (self__.len_size + cljs.core.count.call(null,data__$1));
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.octet$spec$ISpec$read$arity$3 = ((function (len_size){
return (function (_,buff,pos){
var self__ = this;
var ___$1 = this;
var datasize = octet.core.read.call(null,buff,self__.length_spec,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
var data = octet.buffer.read_bytes.call(null,buff,(pos + self__.len_size),datasize);
var data__$1 = octet.spec.string.bytes__GT_string.call(null,data,datasize);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(datasize + self__.len_size),data__$1], null);
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.prototype.octet$spec$ISpec$write$arity$4 = ((function (len_size){
return (function (_,buff,pos,value){
var self__ = this;
var ___$1 = this;
var input = octet.spec.string.string__GT_bytes.call(null,value);
var length = cljs.core.count.call(null,input);
octet.core.write_BANG_.call(null,buff,self__.length_spec,pos,length);

octet.buffer.write_bytes.call(null,buff,(pos + self__.len_size),length,input);

return (length + self__.len_size);
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.getBasis = ((function (len_size){
return (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"length-spec","length-spec",-1802545726,null),new cljs.core.Symbol(null,"len-size","len-size",1194866842,null),new cljs.core.Symbol(null,"meta27583","meta27583",-726692906,null)], null);
});})(len_size))
;

weathergen.falcon.files.t_weathergen$falcon$files27582.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27582.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27582";

weathergen.falcon.files.t_weathergen$falcon$files27582.cljs$lang$ctorPrWriter = ((function (len_size){
return (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27582");
});})(len_size))
;

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27582.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27582 = ((function (len_size){
return (function weathergen$falcon$files$lstring_$___GT_t_weathergen$falcon$files27582(length_spec__$1,len_size__$1,meta27583){
return (new weathergen.falcon.files.t_weathergen$falcon$files27582(length_spec__$1,len_size__$1,meta27583));
});})(len_size))
;

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27582(length_spec,len_size,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Returns `s` trimmed of any trailing null characters.
 */
weathergen.falcon.files.remove_trailing_nulls = (function weathergen$falcon$files$remove_trailing_nulls(s){
return cljs.core.subs.call(null,s,(0),cljs.core.count.call(null,cljs.core.take_while.call(null,(function (p1__27586_SHARP_){
return (!((p1__27586_SHARP_.charCodeAt() === (0))));
}),s)));
});
/**
 * Octet spec for a string of a fixed size. Removes trailing null
 *   characters, if any, unline `buf/string`.
 */
weathergen.falcon.files.fixed_string = (function weathergen$falcon$files$fixed_string(size){
var spc = octet.core.string.call(null,size);
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27587 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
 * @implements {octet.spec.ISpecSize}
*/
weathergen.falcon.files.t_weathergen$falcon$files27587 = (function (size,spc,meta27588){
this.size = size;
this.spc = spc;
this.meta27588 = meta27588;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (spc){
return (function (_27589,meta27588__$1){
var self__ = this;
var _27589__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27587(self__.size,self__.spc,meta27588__$1));
});})(spc))
;

weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (spc){
return (function (_27589){
var self__ = this;
var _27589__$1 = this;
return self__.meta27588;
});})(spc))
;

weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.octet$spec$ISpecSize$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.octet$spec$ISpecSize$size$arity$1 = ((function (spc){
return (function (_){
var self__ = this;
var ___$1 = this;
return octet.core.size.call(null,self__.spc);
});})(spc))
;

weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.octet$spec$ISpec$read$arity$3 = ((function (spc){
return (function (_,buff,pos){
var self__ = this;
var ___$1 = this;
var vec__27590 = octet.core.read_STAR_.call(null,buff,self__.spc,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
var size__$1 = cljs.core.nth.call(null,vec__27590,(0),null);
var data = cljs.core.nth.call(null,vec__27590,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [size__$1,weathergen.falcon.files.remove_trailing_nulls.call(null,data)], null);
});})(spc))
;

weathergen.falcon.files.t_weathergen$falcon$files27587.prototype.octet$spec$ISpec$write$arity$4 = ((function (spc){
return (function (_,buff,pos,value){
var self__ = this;
var ___$1 = this;
return octet.core.write_BANG_.call(null,buff,self__.spc,value,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
});})(spc))
;

weathergen.falcon.files.t_weathergen$falcon$files27587.getBasis = ((function (spc){
return (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"size","size",-1555742762,null),new cljs.core.Symbol(null,"spc","spc",-189939168,null),new cljs.core.Symbol(null,"meta27588","meta27588",-1239894604,null)], null);
});})(spc))
;

weathergen.falcon.files.t_weathergen$falcon$files27587.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27587.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27587";

weathergen.falcon.files.t_weathergen$falcon$files27587.cljs$lang$ctorPrWriter = ((function (spc){
return (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27587");
});})(spc))
;

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27587.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27587 = ((function (spc){
return (function weathergen$falcon$files$fixed_string_$___GT_t_weathergen$falcon$files27587(size__$1,spc__$1,meta27588){
return (new weathergen.falcon.files.t_weathergen$falcon$files27587(size__$1,spc__$1,meta27588));
});})(spc))
;

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27587(size,spc,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Octet spec for a length prefixed array.
 */
weathergen.falcon.files.larray = (function weathergen$falcon$files$larray(var_args){
var args__4736__auto__ = [];
var len__4730__auto___27609 = arguments.length;
var i__4731__auto___27610 = (0);
while(true){
if((i__4731__auto___27610 < len__4730__auto___27609)){
args__4736__auto__.push((arguments[i__4731__auto___27610]));

var G__27611 = (i__4731__auto___27610 + (1));
i__4731__auto___27610 = G__27611;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((2) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((2)),(0),null)):null);
return weathergen.falcon.files.larray.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4737__auto__);
});

weathergen.falcon.files.larray.cljs$core$IFn$_invoke$arity$variadic = (function (length_spec,item_spec,p__27596){
var vec__27597 = p__27596;
var map__27600 = cljs.core.nth.call(null,vec__27597,(0),null);
var map__27600__$1 = (((((!((map__27600 == null))))?(((((map__27600.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__27600.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__27600):map__27600);
var opts = map__27600__$1;
var limit = cljs.core.get.call(null,map__27600__$1,new cljs.core.Keyword(null,"limit","limit",-1355822363));
var len_size = octet.core.size.call(null,length_spec);
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27602 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {cljs.core.IFn}
 * @implements {octet.spec.ISpecDynamicSize}
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27602 = (function (length_spec,item_spec,p__27596,vec__27597,map__27600,opts,limit,len_size,meta27603){
this.length_spec = length_spec;
this.item_spec = item_spec;
this.p__27596 = p__27596;
this.vec__27597 = vec__27597;
this.map__27600 = map__27600;
this.opts = opts;
this.limit = limit;
this.len_size = len_size;
this.meta27603 = meta27603;
this.cljs$lang$protocol_mask$partition0$ = 393217;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (_27604,meta27603__$1){
var self__ = this;
var _27604__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27602(self__.length_spec,self__.item_spec,self__.p__27596,self__.vec__27597,self__.map__27600,self__.opts,self__.limit,self__.len_size,meta27603__$1));
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (_27604){
var self__ = this;
var _27604__$1 = this;
return self__.meta27603;
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.call = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (self__){
var self__ = this;
var self____$1 = this;
var s = self____$1;
return s;
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.apply = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (self__,args27605){
var self__ = this;
var self____$1 = this;
return self____$1.call.apply(self____$1,[self____$1].concat(cljs.core.aclone.call(null,args27605)));
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.cljs$core$IFn$_invoke$arity$0 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (){
var self__ = this;
var s = this;
return s;
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.octet$spec$ISpecDynamicSize$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.octet$spec$ISpecDynamicSize$size_STAR_$arity$2 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (_,data){
var self__ = this;
var ___$1 = this;
return (self__.len_size + (octet.core.size.call(null,self__.item_spec) * cljs.core.count.call(null,data)));
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.octet$spec$ISpec$read$arity$3 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (_,buff,pos){
var self__ = this;
var ___$1 = this;
var n = octet.core.read.call(null,buff,self__.length_spec,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
var n_STAR_ = (cljs.core.truth_((function (){var and__4120__auto__ = self__.limit;
if(cljs.core.truth_(and__4120__auto__)){
return (self__.limit < n);
} else {
return and__4120__auto__;
}
})())?(function (){
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.falcon.files",null,113,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (n,___$1,len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (){
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Limiting read in larray spec at",pos,"to",self__.limit,". Originally read value was",n], null);
});})(n,___$1,len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
,null)),null,608702760);

return self__.limit;
})()
:n);
var vec__27606 = octet.core.read_STAR_.call(null,buff,octet.core.repeat.call(null,n_STAR_,self__.item_spec),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),(pos + self__.len_size)], null));
var datasize = cljs.core.nth.call(null,vec__27606,(0),null);
var data = cljs.core.nth.call(null,vec__27606,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(datasize + self__.len_size),data], null);
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.prototype.octet$spec$ISpec$write$arity$4 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (_,buff,pos,value){
var self__ = this;
var ___$1 = this;
var n = cljs.core.count.call(null,value);
return (octet.core.write_BANG_.call(null,buff,n,self__.length_spec,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null)) + octet.core.write_BANG_.call(null,buff,value,octet.core.repeat.call(null,n,self__.item_spec),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),(pos + self__.len_size)], null)));
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.getBasis = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (){
return new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"length-spec","length-spec",-1802545726,null),new cljs.core.Symbol(null,"item-spec","item-spec",1394678941,null),new cljs.core.Symbol(null,"p__27596","p__27596",-2067899394,null),new cljs.core.Symbol(null,"vec__27597","vec__27597",242448367,null),new cljs.core.Symbol(null,"map__27600","map__27600",-1032837075,null),new cljs.core.Symbol(null,"opts","opts",1795607228,null),new cljs.core.Symbol(null,"limit","limit",284709164,null),new cljs.core.Symbol(null,"len-size","len-size",1194866842,null),new cljs.core.Symbol(null,"meta27603","meta27603",966505190,null)], null);
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

weathergen.falcon.files.t_weathergen$falcon$files27602.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27602.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27602";

weathergen.falcon.files.t_weathergen$falcon$files27602.cljs$lang$ctorPrWriter = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27602");
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27602.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27602 = ((function (len_size,vec__27597,map__27600,map__27600__$1,opts,limit){
return (function weathergen$falcon$files$__GT_t_weathergen$falcon$files27602(length_spec__$1,item_spec__$1,p__27596__$1,vec__27597__$1,map__27600__$2,opts__$1,limit__$1,len_size__$1,meta27603){
return (new weathergen.falcon.files.t_weathergen$falcon$files27602(length_spec__$1,item_spec__$1,p__27596__$1,vec__27597__$1,map__27600__$2,opts__$1,limit__$1,len_size__$1,meta27603));
});})(len_size,vec__27597,map__27600,map__27600__$1,opts,limit))
;

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27602(length_spec,item_spec,p__27596,vec__27597,map__27600__$1,opts,limit,len_size,cljs.core.PersistentArrayMap.EMPTY));
});

weathergen.falcon.files.larray.cljs$lang$maxFixedArity = (2);

/** @this {Function} */
weathergen.falcon.files.larray.cljs$lang$applyTo = (function (seq27593){
var G__27594 = cljs.core.first.call(null,seq27593);
var seq27593__$1 = cljs.core.next.call(null,seq27593);
var G__27595 = cljs.core.first.call(null,seq27593__$1);
var seq27593__$2 = cljs.core.next.call(null,seq27593__$1);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__27594,G__27595,seq27593__$2);
});

/**
 * Returns a spec that passes through to `spec` but reports on various
 *   aspects when used.
 */
weathergen.falcon.files.debug_spec = (function weathergen$falcon$files$debug_spec(var_args){
var G__27613 = arguments.length;
switch (G__27613) {
case 1:
return weathergen.falcon.files.debug_spec.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 2:
return weathergen.falcon.files.debug_spec.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
default:
throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));

}
});

weathergen.falcon.files.debug_spec.cljs$core$IFn$_invoke$arity$1 = (function (spec){
return weathergen.falcon.files.debug_spec.call(null,cljs.core.PersistentArrayMap.EMPTY,spec);
});

weathergen.falcon.files.debug_spec.cljs$core$IFn$_invoke$arity$2 = (function (p__27614,spec){
var map__27615 = p__27614;
var map__27615__$1 = (((((!((map__27615 == null))))?(((((map__27615.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__27615.cljs$core$ISeq$))))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__27615):map__27615);
var opts = map__27615__$1;
var msg = cljs.core.get.call(null,map__27615__$1,new cljs.core.Keyword(null,"msg","msg",-1386103444));
var level = cljs.core.get.call(null,map__27615__$1,new cljs.core.Keyword(null,"level","level",1290497552),new cljs.core.Keyword(null,"debug","debug",-1608172596));
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27617 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {cljs.core.IFn}
 * @implements {octet.spec.ISpecDynamicSize}
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27617 = (function (p__27614,spec,map__27615,opts,msg,level,meta27618){
this.p__27614 = p__27614;
this.spec = spec;
this.map__27615 = map__27615;
this.opts = opts;
this.msg = msg;
this.level = level;
this.meta27618 = meta27618;
this.cljs$lang$protocol_mask$partition0$ = 393217;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (_27619,meta27618__$1){
var self__ = this;
var _27619__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27617(self__.p__27614,self__.spec,self__.map__27615,self__.opts,self__.msg,self__.level,meta27618__$1));
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (_27619){
var self__ = this;
var _27619__$1 = this;
return self__.meta27618;
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.call = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (self__){
var self__ = this;
var self____$1 = this;
var s = self____$1;
return cljs.core._invoke.call(null,self__.spec);
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.apply = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (self__,args27620){
var self__ = this;
var self____$1 = this;
return self____$1.call.apply(self____$1,[self____$1].concat(cljs.core.aclone.call(null,args27620)));
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.cljs$core$IFn$_invoke$arity$0 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (){
var self__ = this;
var s = this;
return cljs.core._invoke.call(null,self__.spec);
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.octet$spec$ISpecDynamicSize$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.octet$spec$ISpecDynamicSize$size_STAR_$arity$2 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (_,data){
var self__ = this;
var ___$1 = this;
return octet.spec.size_STAR_.call(null,self__.spec,data);
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.octet$spec$ISpec$read$arity$3 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (_,buff,pos){
var self__ = this;
var ___$1 = this;
if(cljs.core.not_EQ_.call(null,self__.level,new cljs.core.Keyword(null,"off","off",606440789))){
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,self__.level,"weathergen.falcon.files",null,149,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (___$1,map__27615,map__27615__$1,opts,msg,level){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__4131__auto__ = self__.msg;
if(cljs.core.truth_(or__4131__auto__)){
return or__4131__auto__;
} else {
return "debug-spec/read";
}
})(),pos], null);
});})(___$1,map__27615,map__27615__$1,opts,msg,level))
,null)),null,-1951103277);
} else {
}

return octet.spec.read.call(null,self__.spec,buff,pos);
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.prototype.octet$spec$ISpec$write$arity$4 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (_,buff,pos,value){
var self__ = this;
var ___$1 = this;
return octet.spec.write.call(null,self__.spec,buff,pos,value);
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.getBasis = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p__27614","p__27614",615124080,null),new cljs.core.Symbol(null,"spec","spec",1988051928,null),new cljs.core.Symbol(null,"map__27615","map__27615",1380052394,null),new cljs.core.Symbol(null,"opts","opts",1795607228,null),new cljs.core.Symbol(null,"msg","msg",254428083,null),new cljs.core.Symbol(null,"level","level",-1363938217,null),new cljs.core.Symbol(null,"meta27618","meta27618",-261815034,null)], null);
});})(map__27615,map__27615__$1,opts,msg,level))
;

weathergen.falcon.files.t_weathergen$falcon$files27617.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27617.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27617";

weathergen.falcon.files.t_weathergen$falcon$files27617.cljs$lang$ctorPrWriter = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27617");
});})(map__27615,map__27615__$1,opts,msg,level))
;

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27617.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27617 = ((function (map__27615,map__27615__$1,opts,msg,level){
return (function weathergen$falcon$files$__GT_t_weathergen$falcon$files27617(p__27614__$1,spec__$1,map__27615__$2,opts__$1,msg__$1,level__$1,meta27618){
return (new weathergen.falcon.files.t_weathergen$falcon$files27617(p__27614__$1,spec__$1,map__27615__$2,opts__$1,msg__$1,level__$1,meta27618));
});})(map__27615,map__27615__$1,opts,msg,level))
;

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27617(p__27614,spec,map__27615__$1,opts,msg,level,cljs.core.PersistentArrayMap.EMPTY));
});

weathergen.falcon.files.debug_spec.cljs$lang$maxFixedArity = 2;

/**
 * Returns a spec that decodes from read values via the mapping in m.
 */
weathergen.falcon.files.enum$ = (function weathergen$falcon$files$enum(item_spec,m){
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27622 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
 * @implements {octet.spec.ISpecSize}
*/
weathergen.falcon.files.t_weathergen$falcon$files27622 = (function (item_spec,m,meta27623){
this.item_spec = item_spec;
this.m = m;
this.meta27623 = meta27623;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27622.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_27624,meta27623__$1){
var self__ = this;
var _27624__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27622(self__.item_spec,self__.m,meta27623__$1));
});

weathergen.falcon.files.t_weathergen$falcon$files27622.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_27624){
var self__ = this;
var _27624__$1 = this;
return self__.meta27623;
});

weathergen.falcon.files.t_weathergen$falcon$files27622.prototype.octet$spec$ISpecSize$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27622.prototype.octet$spec$ISpecSize$size$arity$1 = (function (_){
var self__ = this;
var ___$1 = this;
return octet.core.size.call(null,self__.item_spec);
});

weathergen.falcon.files.t_weathergen$falcon$files27622.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27622.prototype.octet$spec$ISpec$read$arity$3 = (function (_,buf,pos){
var self__ = this;
var ___$1 = this;
var vec__27625 = octet.core.read_STAR_.call(null,buf,self__.item_spec,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
var datasize = cljs.core.nth.call(null,vec__27625,(0),null);
var val = cljs.core.nth.call(null,vec__27625,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [datasize,self__.m.call(null,val,val)], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27622.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"item-spec","item-spec",1394678941,null),new cljs.core.Symbol(null,"m","m",-1021758608,null),new cljs.core.Symbol(null,"meta27623","meta27623",-1449108134,null)], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27622.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27622.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27622";

weathergen.falcon.files.t_weathergen$falcon$files27622.cljs$lang$ctorPrWriter = (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27622");
});

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27622.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27622 = (function weathergen$falcon$files$enum_$___GT_t_weathergen$falcon$files27622(item_spec__$1,m__$1,meta27623){
return (new weathergen.falcon.files.t_weathergen$falcon$files27622(item_spec__$1,m__$1,meta27623));
});

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27622(item_spec,m,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Returns a spec that decodes from a read value into a set of bits
 *   based on the mapping in m. Resulting set will also include the raw
 *   value being decoded.
 */
weathergen.falcon.files.bitflags = (function weathergen$falcon$files$bitflags(item_spec,m){
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27628 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27628 = (function (item_spec,m,meta27629){
this.item_spec = item_spec;
this.m = m;
this.meta27629 = meta27629;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27628.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_27630,meta27629__$1){
var self__ = this;
var _27630__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27628(self__.item_spec,self__.m,meta27629__$1));
});

weathergen.falcon.files.t_weathergen$falcon$files27628.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_27630){
var self__ = this;
var _27630__$1 = this;
return self__.meta27629;
});

weathergen.falcon.files.t_weathergen$falcon$files27628.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27628.prototype.octet$spec$ISpec$read$arity$3 = (function (_,buf,pos){
var self__ = this;
var ___$1 = this;
var vec__27631 = octet.core.read_STAR_.call(null,buf,self__.item_spec,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
var datasize = cljs.core.nth.call(null,vec__27631,(0),null);
var val = cljs.core.nth.call(null,vec__27631,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [datasize,cljs.core.into.call(null,cljs.core.PersistentHashSet.createAsIfByAssoc([val]),cljs.core.remove.call(null,cljs.core.nil_QMARK_,(function (){var iter__4523__auto__ = ((function (vec__27631,datasize,val,___$1){
return (function weathergen$falcon$files$bitflags_$_iter__27634(s__27635){
return (new cljs.core.LazySeq(null,((function (vec__27631,datasize,val,___$1){
return (function (){
var s__27635__$1 = s__27635;
while(true){
var temp__5720__auto__ = cljs.core.seq.call(null,s__27635__$1);
if(temp__5720__auto__){
var s__27635__$2 = temp__5720__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__27635__$2)){
var c__4521__auto__ = cljs.core.chunk_first.call(null,s__27635__$2);
var size__4522__auto__ = cljs.core.count.call(null,c__4521__auto__);
var b__27637 = cljs.core.chunk_buffer.call(null,size__4522__auto__);
if((function (){var i__27636 = (0);
while(true){
if((i__27636 < size__4522__auto__)){
var vec__27638 = cljs.core._nth.call(null,c__4521__auto__,i__27636);
var flag = cljs.core.nth.call(null,vec__27638,(0),null);
var mask = cljs.core.nth.call(null,vec__27638,(1),null);
cljs.core.chunk_append.call(null,b__27637,((weathergen.util.has_flag_QMARK_.call(null,val,mask))?flag:null));

var G__27644 = (i__27636 + (1));
i__27636 = G__27644;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__27637),weathergen$falcon$files$bitflags_$_iter__27634.call(null,cljs.core.chunk_rest.call(null,s__27635__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__27637),null);
}
} else {
var vec__27641 = cljs.core.first.call(null,s__27635__$2);
var flag = cljs.core.nth.call(null,vec__27641,(0),null);
var mask = cljs.core.nth.call(null,vec__27641,(1),null);
return cljs.core.cons.call(null,((weathergen.util.has_flag_QMARK_.call(null,val,mask))?flag:null),weathergen$falcon$files$bitflags_$_iter__27634.call(null,cljs.core.rest.call(null,s__27635__$2)));
}
} else {
return null;
}
break;
}
});})(vec__27631,datasize,val,___$1))
,null,null));
});})(vec__27631,datasize,val,___$1))
;
return iter__4523__auto__.call(null,self__.m);
})()))], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27628.getBasis = (function (){
return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"item-spec","item-spec",1394678941,null),new cljs.core.Symbol(null,"m","m",-1021758608,null),new cljs.core.Symbol(null,"meta27629","meta27629",-1506138386,null)], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27628.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27628.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27628";

weathergen.falcon.files.t_weathergen$falcon$files27628.cljs$lang$ctorPrWriter = (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27628");
});

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27628.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27628 = (function weathergen$falcon$files$bitflags_$___GT_t_weathergen$falcon$files27628(item_spec__$1,m__$1,meta27629){
return (new weathergen.falcon.files.t_weathergen$falcon$files27628(item_spec__$1,m__$1,meta27629));
});

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27628(item_spec,m,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Returns a spec that consumes and produces no data, but reads a
 *   constant value.
 */
weathergen.falcon.files.constant = (function weathergen$falcon$files$constant(val){
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27645 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27645 = (function (val,meta27646){
this.val = val;
this.meta27646 = meta27646;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27645.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_27647,meta27646__$1){
var self__ = this;
var _27647__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27645(self__.val,meta27646__$1));
});

weathergen.falcon.files.t_weathergen$falcon$files27645.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_27647){
var self__ = this;
var _27647__$1 = this;
return self__.meta27646;
});

weathergen.falcon.files.t_weathergen$falcon$files27645.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27645.prototype.octet$spec$ISpec$read$arity$3 = (function (_,___$1,___$2){
var self__ = this;
var ___$3 = this;
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),self__.val], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27645.prototype.octet$spec$ISpec$write$arity$4 = (function (_,___$1,___$2,___$3){
var self__ = this;
var ___$4 = this;
return null;
});

weathergen.falcon.files.t_weathergen$falcon$files27645.getBasis = (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"val","val",1769233139,null),new cljs.core.Symbol(null,"meta27646","meta27646",1616463861,null)], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27645.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27645.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27645";

weathergen.falcon.files.t_weathergen$falcon$files27645.cljs$lang$ctorPrWriter = (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27645");
});

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27645.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27645 = (function weathergen$falcon$files$constant_$___GT_t_weathergen$falcon$files27645(val__$1,meta27646){
return (new weathergen.falcon.files.t_weathergen$falcon$files27645(val__$1,meta27646));
});

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27645(val,cljs.core.PersistentArrayMap.EMPTY));
});
/**
 * Read thread operator. Composes a read against multiple (potentially
 *   dynamically determined) specs passing the accumulated read value in
 *   turn through spec-fns, each a function from the accumulator to a
 *   spec.
 */
weathergen.falcon.files.read__GT_ = (function weathergen$falcon$files$read__GT_(var_args){
var args__4736__auto__ = [];
var len__4730__auto___27670 = arguments.length;
var i__4731__auto___27671 = (0);
while(true){
if((i__4731__auto___27671 < len__4730__auto___27670)){
args__4736__auto__.push((arguments[i__4731__auto___27671]));

var G__27672 = (i__4731__auto___27671 + (1));
i__4731__auto___27671 = G__27672;
continue;
} else {
}
break;
}

var argseq__4737__auto__ = ((((2) < args__4736__auto__.length))?(new cljs.core.IndexedSeq(args__4736__auto__.slice((2)),(0),null)):null);
return weathergen.falcon.files.read__GT_.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4737__auto__);
});

weathergen.falcon.files.read__GT_.cljs$core$IFn$_invoke$arity$variadic = (function (buf,offset,spec_fns){
var size = (0);
var data = cljs.core.PersistentArrayMap.EMPTY;
var G__27654 = spec_fns;
var vec__27655 = G__27654;
var seq__27656 = cljs.core.seq.call(null,vec__27655);
var first__27657 = cljs.core.first.call(null,seq__27656);
var seq__27656__$1 = cljs.core.next.call(null,seq__27656);
var spec_fn = first__27657;
var more = seq__27656__$1;
var size__$1 = size;
var data__$1 = data;
var G__27654__$1 = G__27654;
while(true){
var size__$2 = size__$1;
var data__$2 = data__$1;
var vec__27664 = G__27654__$1;
var seq__27665 = cljs.core.seq.call(null,vec__27664);
var first__27666 = cljs.core.first.call(null,seq__27665);
var seq__27665__$1 = cljs.core.next.call(null,seq__27665);
var spec_fn__$1 = first__27666;
var more__$1 = seq__27665__$1;
if(cljs.core.not.call(null,spec_fn__$1)){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [size__$2,data__$2], null);
} else {
var vec__27667 = octet.core.read_STAR_.call(null,buf,spec_fn__$1.call(null,data__$2),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),(offset + size__$2)], null));
var size_STAR_ = cljs.core.nth.call(null,vec__27667,(0),null);
var data_STAR_ = cljs.core.nth.call(null,vec__27667,(1),null);
var G__27673 = (size__$2 + size_STAR_);
var G__27674 = cljs.core.merge.call(null,data__$2,data_STAR_);
var G__27675 = more__$1;
size__$1 = G__27673;
data__$1 = G__27674;
G__27654__$1 = G__27675;
continue;
}
break;
}
});

weathergen.falcon.files.read__GT_.cljs$lang$maxFixedArity = (2);

/** @this {Function} */
weathergen.falcon.files.read__GT_.cljs$lang$applyTo = (function (seq27648){
var G__27649 = cljs.core.first.call(null,seq27648);
var seq27648__$1 = cljs.core.next.call(null,seq27648);
var G__27650 = cljs.core.first.call(null,seq27648__$1);
var seq27648__$2 = cljs.core.next.call(null,seq27648__$1);
var self__4717__auto__ = this;
return self__4717__auto__.cljs$core$IFn$_invoke$arity$variadic(G__27649,G__27650,seq27648__$2);
});

/**
 * Returns a spec that conditionally reads/write a map. It first reads
 *   `flag-spec`, then passes the value to `flag-pred`. Depending on the
 *   value returned, either reads `true-spec` or `false-spec`. Read
 *   values are returned under keys `flag-key` and `branch-key`.
 */
weathergen.falcon.files.spec_if = (function weathergen$falcon$files$spec_if(flag_key,flag_spec,flag_pred,branch_key,true_spec,false_spec){
if((typeof weathergen !== 'undefined') && (typeof weathergen.falcon !== 'undefined') && (typeof weathergen.falcon.files !== 'undefined') && (typeof weathergen.falcon.files.t_weathergen$falcon$files27676 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {octet.spec.ISpec}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
weathergen.falcon.files.t_weathergen$falcon$files27676 = (function (flag_key,flag_spec,flag_pred,branch_key,true_spec,false_spec,meta27677){
this.flag_key = flag_key;
this.flag_spec = flag_spec;
this.flag_pred = flag_pred;
this.branch_key = branch_key;
this.true_spec = true_spec;
this.false_spec = false_spec;
this.meta27677 = meta27677;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
weathergen.falcon.files.t_weathergen$falcon$files27676.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_27678,meta27677__$1){
var self__ = this;
var _27678__$1 = this;
return (new weathergen.falcon.files.t_weathergen$falcon$files27676(self__.flag_key,self__.flag_spec,self__.flag_pred,self__.branch_key,self__.true_spec,self__.false_spec,meta27677__$1));
});

weathergen.falcon.files.t_weathergen$falcon$files27676.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_27678){
var self__ = this;
var _27678__$1 = this;
return self__.meta27677;
});

weathergen.falcon.files.t_weathergen$falcon$files27676.prototype.octet$spec$ISpec$ = cljs.core.PROTOCOL_SENTINEL;

weathergen.falcon.files.t_weathergen$falcon$files27676.prototype.octet$spec$ISpec$read$arity$3 = (function (_,buf,pos){
var self__ = this;
var ___$1 = this;
var vec__27679 = octet.core.read_STAR_.call(null,buf,self__.flag_spec,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),pos], null));
var flag_size = cljs.core.nth.call(null,vec__27679,(0),null);
var flag_val = cljs.core.nth.call(null,vec__27679,(1),null);
var vec__27682 = octet.core.read_STAR_.call(null,buf,(cljs.core.truth_(self__.flag_pred.call(null,flag_val))?self__.true_spec:self__.false_spec),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"offset","offset",296498311),(pos + flag_size)], null));
var branch_size = cljs.core.nth.call(null,vec__27682,(0),null);
var branch_val = cljs.core.nth.call(null,vec__27682,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(flag_size + branch_size),cljs.core.PersistentHashMap.fromArrays([self__.flag_key,self__.branch_key],[flag_val,branch_val])], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27676.getBasis = (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"flag-key","flag-key",-1036087809,null),new cljs.core.Symbol(null,"flag-spec","flag-spec",-648358532,null),new cljs.core.Symbol(null,"flag-pred","flag-pred",-548885820,null),new cljs.core.Symbol(null,"branch-key","branch-key",1453905826,null),new cljs.core.Symbol(null,"true-spec","true-spec",-704610023,null),new cljs.core.Symbol(null,"false-spec","false-spec",432945414,null),new cljs.core.Symbol(null,"meta27677","meta27677",-1423874968,null)], null);
});

weathergen.falcon.files.t_weathergen$falcon$files27676.cljs$lang$type = true;

weathergen.falcon.files.t_weathergen$falcon$files27676.cljs$lang$ctorStr = "weathergen.falcon.files/t_weathergen$falcon$files27676";

weathergen.falcon.files.t_weathergen$falcon$files27676.cljs$lang$ctorPrWriter = (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"weathergen.falcon.files/t_weathergen$falcon$files27676");
});

/**
 * Positional factory function for weathergen.falcon.files/t_weathergen$falcon$files27676.
 */
weathergen.falcon.files.__GT_t_weathergen$falcon$files27676 = (function weathergen$falcon$files$spec_if_$___GT_t_weathergen$falcon$files27676(flag_key__$1,flag_spec__$1,flag_pred__$1,branch_key__$1,true_spec__$1,false_spec__$1,meta27677){
return (new weathergen.falcon.files.t_weathergen$falcon$files27676(flag_key__$1,flag_spec__$1,flag_pred__$1,branch_key__$1,true_spec__$1,false_spec__$1,meta27677));
});

}

return (new weathergen.falcon.files.t_weathergen$falcon$files27676(flag_key,flag_spec,flag_pred,branch_key,true_spec,false_spec,cljs.core.PersistentArrayMap.EMPTY));
});
