var LazyValue=function($container){var me=this;$container=$($container),this.url=$container.attr("data-lazy-value"),this.watch=function(){try{$.post(me.url,{},function(res){var finish=!1;if("object"==typeof res&&"code"in res&&"data"in res&&"value"in res.data&&"status"in res.data&&0===res.code){finish="finish"===res.data.status;for(var k in res.data.value){var $callback=$('[data-lazy-value-item="'+k+'"][data-lazy-value-callback]');if(0===$callback.length)if("object"==typeof res.data.value[k])for(var kk in res.data.value[k])$('[data-lazy-value-item="'+k+'"][data-lazy-value-key="'+kk+'"]').html(res.data.value[k][kk]);else $('[data-lazy-value-item="'+k+'"]').html(res.data.value[k]);else{var callback=$callback.attr("data-lazy-value-callback");callback=eval(callback+"("+JSON.stringify(res.data.value[k])+")")}}}finish?$container.find("[data-lazy-value-loading]").hide():setTimeout(me.watch,5e3)})}catch(a){setTimeout(me.watch,5e3)}},this.watch()};module.exports=LazyValue;