require.def("preview/harModel",["core/lib","preview/jsonSchema","preview/ref","preview/harSchema","core/cookies","core/trace","jquery-plugins/jquery.json"],function(i,m,n,o,j,k){function f(){this.input=null}function p(){var a={};for(var c in this)if(c!="toJSON")a[c]=this[c];if(!this.text)return a;a.text=Array.map(this.text,function(b){var d=b.charCodeAt(0);if(d>=32&&d<127||d==10||d==13)return b.charAt(0);for(b=d.toString(16).toUpperCase();b.length<4;)b="0"+b;return"\\u"+b}).join("");return a}f.prototype= {append:function(a){if(a){if(this.input)if(a.log.pages)for(var c=0;c0?a[0]:null},getPageEntries:function(a){return f.getPageEntries(this.input, a)},getAllEntries:function(){return this.input?this.input.log.entries:[]},getParentPage:function(a){return f.getParentPage(this.input,a)},importPage:function(a,c){var b=this.getUniquePageID(a.id),d=a.id;a.id=b;this.input.log.pages.push(a);for(a=0;a0)return this.loadRemoteArchive(g,e,a,c);if(b=i.getURLParameter("path"))return this.loadLocalArchive(b,a,c)},loadExample:function(a){var c=document.location.href,b=c.indexOf("?");document.location=c.substr(0,b)+"?path="+a;j.setCookie("timeline",true);j.setCookie("stats",true)},loadLocalArchive:function(a,c,b){$.ajax({url:a,context:this, success:function(d){c(d)},error:function(d,e){b(d,e)}});return true},loadRemoteArchive:function(a,c,b,d){if(!a.length)return false;var e=a.shift();c||(c="onInputData");$.ajax({url:e,context:this,dataType:"jsonp",jsonp:"callback",jsonpCallback:c,success:function(h){b(h);if(a.length){var g=this;setTimeout(function(){g.loadRemoteArchive(a,c,b,d)},300)}},error:function(h,g){d(h,g)}});return true}};return f});