-
Notifications
You must be signed in to change notification settings - Fork 0
/
wavedrom.min.js
2 lines (2 loc) · 46.3 KB
/
wavedrom.min.js
1
2
/*! wavedrom 2.6.7 2020-5-21 PDT */
!function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,(function(r){return o(e[i][1][r]||r)}),p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){"use strict";module.exports=function(index,output){var div,menu;function closeMenu(e){var left=parseInt(menu.style.left,10),top=parseInt(menu.style.top,10);(e.x<left||e.x>left+menu.offsetWidth||e.y<top||e.y>top+menu.offsetHeight)&&(menu.parentNode.removeChild(menu),document.body.removeEventListener("mousedown",closeMenu,!1))}(div=document.getElementById(output+index)).childNodes[0].addEventListener("contextmenu",(function(e){var list,savePng,saveSvg;(menu=document.createElement("div")).className="wavedromMenu",menu.style.top=e.y+"px",menu.style.left=e.x+"px",list=document.createElement("ul"),(savePng=document.createElement("li")).innerHTML="Save as PNG",list.appendChild(savePng),(saveSvg=document.createElement("li")).innerHTML="Save as SVG",list.appendChild(saveSvg),menu.appendChild(list),document.body.appendChild(menu),savePng.addEventListener("click",(function(){var html,firstDiv,svgdata,img,canvas,pngdata,a;html="",0!==index&&(html+=(firstDiv=document.getElementById(output+0)).innerHTML.substring(166,firstDiv.innerHTML.indexOf('<g id="waves_0">'))),html=[div.innerHTML.slice(0,166),html,div.innerHTML.slice(166)].join(""),svgdata="data:image/svg+xml;base64,"+btoa(html),(img=new Image).src=svgdata,(canvas=document.createElement("canvas")).width=img.width,canvas.height=img.height,canvas.getContext("2d").drawImage(img,0,0),pngdata=canvas.toDataURL("image/png"),(a=document.createElement("a")).href=pngdata,a.download="wavedrom.png",a.click(),menu.parentNode.removeChild(menu),document.body.removeEventListener("mousedown",closeMenu,!1)}),!1),saveSvg.addEventListener("click",(function(){var html,firstDiv,svgdata,a;html="",0!==index&&(html+=(firstDiv=document.getElementById(output+0)).innerHTML.substring(166,firstDiv.innerHTML.indexOf('<g id="waves_0">'))),html=[div.innerHTML.slice(0,166),html,div.innerHTML.slice(166)].join(""),svgdata="data:image/svg+xml;base64,"+btoa(html),(a=document.createElement("a")).href=svgdata,a.download="wavedrom.svg",a.click(),menu.parentNode.removeChild(menu),document.body.removeEventListener("mousedown",closeMenu,!1)}),!1),menu.addEventListener("contextmenu",(function(ee){ee.preventDefault()}),!1),document.body.addEventListener("mousedown",closeMenu,!1),e.preventDefault()}),!1)}},{}],2:[function(require,module,exports){"use strict";module.exports=function(Edge,from,to){var d,style,dx=to.x-from.x,dy=to.y-from.y,lx=(from.x+to.x)/2,ly=(from.y+to.y)/2;switch(Edge.shape){case"-":break;case"~":d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+.3*dx+", "+dy+" "+dx+", "+dy;break;case"-~":d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.75*(to.x-from.x));break;case"~-":d="M "+from.x+","+from.y+" c 0, 0 "+.3*dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.25*(to.x-from.x));break;case"-|":d="m "+from.x+","+from.y+" "+dx+",0 0,"+dy,Edge.label&&(lx=to.x);break;case"|-":d="m "+from.x+","+from.y+" 0,"+dy+" "+dx+",0",Edge.label&&(lx=from.x);break;case"-|-":d="m "+from.x+","+from.y+" "+dx/2+",0 0,"+dy+" "+dx/2+",0";break;case"->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none";break;case"~>":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+.3*dx+", "+dy+" "+dx+", "+dy;break;case"-~>":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.75*(to.x-from.x));break;case"~->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c 0, 0 "+.3*dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.25*(to.x-from.x));break;case"-|>":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx+",0 0,"+dy,Edge.label&&(lx=to.x);break;case"|->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" 0,"+dy+" "+dx+",0",Edge.label&&(lx=from.x);break;case"-|->":style="marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx/2+",0 0,"+dy+" "+dx/2+",0";break;case"<->":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none";break;case"<~>":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+.3*dx+", "+dy+" "+dx+", "+dy;break;case"<-~>":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="M "+from.x+","+from.y+" c "+.7*dx+", 0 "+dx+", "+dy+" "+dx+", "+dy,Edge.label&&(lx=from.x+.75*(to.x-from.x));break;case"<-|>":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx+",0 0,"+dy,Edge.label&&(lx=to.x);break;case"<-|->":style="marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none",d="m "+from.x+","+from.y+" "+dx/2+",0 0,"+dy+" "+dx/2+",0";break;default:style="fill:none;stroke:#F00;stroke-width:1"}return{lx:lx,ly:ly,d:d,style:style}}},{}],3:[function(require,module,exports){module.exports={chars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,47,74,74,118,89,25,44,44,52,78,37,44,37,37,74,74,74,74,74,74,74,74,74,74,37,37,78,78,78,74,135,89,89,96,96,89,81,103,96,37,67,89,74,109,96,103,89,103,96,89,81,96,89,127,89,87,81,37,37,37,61,74,44,74,74,67,74,74,37,74,74,30,30,67,30,112,74,74,74,74,44,67,37,74,67,95,66,65,67,44,34,44,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,43,74,74,74,74,34,74,44,98,49,74,78,0,98,73,53,73,44,44,44,77,71,37,44,44,49,74,111,111,111,81,89,89,89,89,89,89,133,96,89,89,89,89,37,37,37,37,96,96,103,103,103,103,103,78,103,96,96,96,96,87,89,81,74,74,74,74,74,74,118,67,74,74,74,74,36,36,36,36,74,74,74,74,74,74,74,73,81,74,74,74,74,65,74,65,89,74,89,74,89,74,96,67,96,67,96,67,96,67,96,82,96,74,89,74,89,74,89,74,89,74,89,74,103,74,103,74,103,74,103,74,96,74,96,74,37,36,37,36,37,36,37,30,37,36,98,59,67,30,89,67,67,74,30,74,30,74,39,74,44,74,30,96,74,96,74,96,74,80,96,74,103,74,103,74,103,74,133,126,96,44,96,44,96,44,89,67,89,67,89,67,89,67,81,38,81,50,81,37,96,74,96,74,96,74,96,74,96,74,96,74,127,95,87,65,87,81,67,81,67,81,67,30,84,97,91,84,91,84,94,92,73,104,109,91,84,81,84,100,82,76,74,103,91,131,47,40,99,77,37,79,130,100,84,104,114,87,126,101,87,84,93,84,69,84,46,52,82,52,82,114,89,102,96,100,98,91,70,88,88,77,70,85,89,77,67,84,39,65,61,39,189,173,153,111,105,61,123,123,106,89,74,37,30,103,74,96,74,96,74,96,74,96,74,96,74,81,91,81,91,81,130,131,102,84,103,84,87,78,104,81,104,81,88,76,37,189,173,153,103,84,148,90,100,84,89,74,133,118,103,81],other:114}},{}],4:[function(require,module,exports){"use strict";var onmlStringify=require("onml/lib/stringify.js"),w3=require("./w3.js");module.exports=function(arr){arr[1].xmlns=w3.svg,arr[1]["xmlns:xlink"]=w3.xlink;var s1=onmlStringify(arr);return(new DOMParser).parseFromString(s1,"image/svg+xml").firstChild}},{"./w3.js":32,"onml/lib/stringify.js":41}],5:[function(require,module,exports){"use strict";var eva=require("./eva.js"),renderWaveForm=require("./render-wave-form.js");module.exports=function(){renderWaveForm(0,eva("InputJSON_0"),"WaveDrom_Display_")}},{"./eva.js":6,"./render-wave-form.js":29}],6:[function(require,module,exports){"use strict";function eva(id){var TheTextBox,source;function erra(e){return{signal:[{name:["tspan",["tspan",{class:"error h5"},"Error: "],e.message]}]}}if(TheTextBox=document.getElementById(id),TheTextBox.type&&"textarea"===TheTextBox.type)try{source=eval("("+TheTextBox.value+")")}catch(e){return erra(e)}else try{source=eval("("+TheTextBox.innerHTML+")")}catch(e){return erra(e)}if("[object Object]"!==Object.prototype.toString.call(source))return erra({message:'[Semantic]: The root has to be an Object: "{signal:[...]}"'});if(source.signal){if("[object Array]"!==Object.prototype.toString.call(source.signal))return erra({message:'[Semantic]: "signal" object has to be an Array "signal:[]"'})}else if(source.assign){if("[object Array]"!==Object.prototype.toString.call(source.assign))return erra({message:'[Semantic]: "assign" object hasto be an Array "assign:[]"'})}else if(!source.reg)return erra({message:'[Semantic]: "signal:[...]" or "assign:[...]" property is missing inside the root Object'});return source}module.exports=eva},{}],7:[function(require,module,exports){"use strict";module.exports=function(lanetext){var gcount=0,lcount=0,ret=[];return lanetext.forEach((function(e){"vvv-2"===e||"vvv-3"===e||"vvv-4"===e||"vvv-5"===e||"vvv-6"===e||"vvv-7"===e||"vvv-8"===e||"vvv-9"===e?lcount+=1:0!==lcount&&(ret.push(gcount-(lcount+1)/2),lcount=0),gcount+=1})),0!==lcount&&ret.push(gcount-(lcount+1)/2),ret}},{}],8:[function(require,module,exports){"use strict";module.exports=function(texts,extra,times){var i,j,R=[];if(4===texts.length){for(j=0;j<times;j+=1){for(R.push(texts[0]),i=0;i<extra;i+=1)R.push(texts[1]);for(R.push(texts[2]),i=0;i<extra;i+=1)R.push(texts[3])}return R}for(1===texts.length&&texts.push(texts[0]),R.push(texts[0]),i=0;i<times*(2*(extra+1))-1;i+=1)R.push(texts[1]);return R}},{}],9:[function(require,module,exports){"use strict";var genBrick=require("./gen-brick.js");module.exports=function(text,extra,times){var tmp;switch(tmp=[],text){case"p":tmp=genBrick(["pclk","111","nclk","000"],extra,times);break;case"n":tmp=genBrick(["nclk","000","pclk","111"],extra,times);break;case"P":tmp=genBrick(["Pclk","111","nclk","000"],extra,times);break;case"N":tmp=genBrick(["Nclk","000","pclk","111"],extra,times);break;case"l":case"L":case"0":tmp=genBrick(["000"],extra,times);break;case"h":case"H":case"1":tmp=genBrick(["111"],extra,times);break;case"=":case"2":tmp=genBrick(["vvv-2"],extra,times);break;case"3":tmp=genBrick(["vvv-3"],extra,times);break;case"4":tmp=genBrick(["vvv-4"],extra,times);break;case"5":tmp=genBrick(["vvv-5"],extra,times);break;case"6":tmp=genBrick(["vvv-6"],extra,times);break;case"7":tmp=genBrick(["vvv-7"],extra,times);break;case"8":tmp=genBrick(["vvv-8"],extra,times);break;case"9":tmp=genBrick(["vvv-9"],extra,times);break;case"d":tmp=genBrick(["ddd"],extra,times);break;case"u":tmp=genBrick(["uuu"],extra,times);break;case"z":tmp=genBrick(["zzz"],extra,times);break;default:tmp=genBrick(["xxx"],extra,times)}return tmp}},{"./gen-brick.js":8}],10:[function(require,module,exports){"use strict";var genBrick=require("./gen-brick.js");module.exports=function(text,extra,times){var x1,x2,x3,y1,y2,x5,x6,xclude,atext,tmp0,tmp1,tmp2,tmp3,tmp4;return x1={p:"pclk",n:"nclk",P:"Pclk",N:"Nclk",h:"pclk",l:"nclk",H:"Pclk",L:"Nclk"},x2={0:"0",1:"1",x:"x",d:"d",u:"u",z:"z","=":"v",2:"v",3:"v",4:"v",5:"v",6:"v",7:"v",8:"v",9:"v"},x3={0:"",1:"",x:"",d:"",u:"",z:"","=":"-2",2:"-2",3:"-3",4:"-4",5:"-5",6:"-6",7:"-7",8:"-8",9:"-9"},y1={p:"0",n:"1",P:"0",N:"1",h:"1",l:"0",H:"1",L:"0",0:"0",1:"1",x:"x",d:"d",u:"u",z:"z","=":"v",2:"v",3:"v",4:"v",5:"v",6:"v",7:"v",8:"v",9:"v"},y2={p:"",n:"",P:"",N:"",h:"",l:"",H:"",L:"",0:"",1:"",x:"",d:"",u:"",z:"","=":"-2",2:"-2",3:"-3",4:"-4",5:"-5",6:"-6",7:"-7",8:"-8",9:"-9"},x5={p:"nclk",n:"pclk",P:"nclk",N:"pclk"},x6={p:"000",n:"111",P:"000",N:"111"},xclude={hp:"111",Hp:"111",ln:"000",Ln:"000",nh:"111",Nh:"111",pl:"000",Pl:"000"},tmp0={p:"111",n:"000",P:"111",N:"000",h:"111",l:"000",H:"111",L:"000",0:"000",1:"111",x:"xxx",d:"ddd",u:"uuu",z:"zzz","=":"vvv-2",2:"vvv-2",3:"vvv-3",4:"vvv-4",5:"vvv-5",6:"vvv-6",7:"vvv-7",8:"vvv-8",9:"vvv-9"}[(atext=text.split(""))[1]],void 0===(tmp1=x1[atext[1]])?void 0===(tmp2=x2[atext[1]])?genBrick(["xxx"],extra,times):(tmp3=y1[atext[0]],genBrick(void 0===tmp3?["xxx"]:[tmp3+"m"+tmp2+y2[atext[0]]+x3[atext[1]],tmp0],extra,times)):(void 0!==(tmp4=xclude[text])&&(tmp1=tmp4),tmp2=x5[atext[1]],genBrick(void 0===tmp2?[tmp1,tmp0]:[tmp1,tmp0,tmp2,x6[atext[1]]],extra,times))}},{"./gen-brick.js":8}],11:[function(require,module,exports){"use strict";var w3=require("./w3.js");module.exports=function(index,source,lane,waveSkin,content,lanes,groups,notFirstSignal){var first,skin,e;for(first in waveSkin)break;skin=waveSkin.default||waveSkin[first],source&&source.config&&source.config.skin&&waveSkin[source.config.skin]&&(skin=waveSkin[source.config.skin]),e=notFirstSignal?["svg",{id:"svg",xmlns:w3.svg,"xmlns:xlink":w3.xlink},["g"]]:skin;var width=lane.xg+lane.xs*(lane.xmax+1),height=content.length*lane.yo+lane.yh0+lane.yh1+lane.yf0+lane.yf1,body=e[e.length-1];body[1]={id:"waves_"+index},body[2]=["g",{id:"lanes_"+index,transform:"translate("+(lane.xg+.5)+", "+(lane.yh0+lane.yh1+.5)+")"}].concat(lanes),body[3]=["g",{id:"groups_"+index},groups];var head=e[1];return head.id="svgcontent_"+index,head.height=height,head.width=width,head.viewBox="0 0 "+width+" "+height,head.overflow="hidden",e}},{"./w3.js":32}],12:[function(require,module,exports){"use strict";module.exports={xs:20,ys:20,xg:120,yh0:0,yh1:0,yf0:0,yf1:0,y0:5,yo:30,tgo:-10,ym:15,xlabel:6,xmax:1,scale:1,head:{},foot:{}}},{}],13:[function(require,module,exports){"use strict";module.exports=function(source,lane){var hscale,x;lane.hscale=1,lane.hscale0&&(lane.hscale=lane.hscale0),source&&source.config&&source.config.hscale&&(hscale=Math.round((x=source.config.hscale)>0?Math.round(x):1))>0&&(hscale>100&&(hscale=100),lane.hscale=hscale),lane.yh0=0,lane.yh1=0,lane.head=source.head,lane.xmin_cfg=0,lane.xmax_cfg=1e12,source&&source.config&&source.config.hbounds&&2==source.config.hbounds.length&&(source.config.hbounds[0]=Math.floor(source.config.hbounds[0]),source.config.hbounds[1]=Math.ceil(source.config.hbounds[1]),source.config.hbounds[0]<source.config.hbounds[1]&&(lane.xmin_cfg=2*Math.floor(source.config.hbounds[0]),lane.xmax_cfg=2*Math.floor(source.config.hbounds[1]))),source&&source.head&&((source.head.tick||0===source.head.tick||source.head.tock||0===source.head.tock)&&(lane.yh0=20),(source.head.tick||0===source.head.tick)&&(source.head.tick=source.head.tick+lane.xmin_cfg/2),(source.head.tock||0===source.head.tock)&&(source.head.tock=source.head.tock+lane.xmin_cfg/2),source.head.text&&(lane.yh1=46,lane.head.text=source.head.text)),lane.yf0=0,lane.yf1=0,lane.foot=source.foot,source&&source.foot&&((source.foot.tick||0===source.foot.tick||source.foot.tock||0===source.foot.tock)&&(lane.yf0=20),(source.foot.tick||0===source.foot.tick)&&(source.foot.tick=source.foot.tick+lane.xmin_cfg/2),(source.foot.tock||0===source.foot.tock)&&(source.foot.tock=source.foot.tock+lane.xmin_cfg/2),source.foot.text&&(lane.yf1=46,lane.foot.text=source.foot.text))}},{}],14:[function(require,module,exports){"use strict";var genFirstWaveBrick=require("./gen-first-wave-brick.js"),genWaveBrick=require("./gen-wave-brick.js"),findLaneMarkers=require("./find-lane-markers.js");module.exports=function(text,extra,lane){var Repeats,Top,Next,i,subCycle,num_unseen_markers,Stack=[],R=[],unseen_bricks=[];for(Next=(Stack=text.split("")).shift(),subCycle=!1,Repeats=1;"."===Stack[0]||"|"===Stack[0];)Stack.shift(),Repeats+=1;for(R=R.concat(genFirstWaveBrick(Next,extra,Repeats));Stack.length;){for(Top=Next,"<"===(Next=Stack.shift())&&(subCycle=!0,Next=Stack.shift()),">"===Next&&(subCycle=!1,Next=Stack.shift()),Repeats=1;"."===Stack[0]||"|"===Stack[0];)Stack.shift(),Repeats+=1;R=subCycle?R.concat(genWaveBrick(Top+Next,0,Repeats-lane.period)):R.concat(genWaveBrick(Top+Next,extra,Repeats))}for(i=0;i<lane.phase;i+=1)unseen_bricks.push(R.shift());return unseen_bricks.length>0?(num_unseen_markers=findLaneMarkers(unseen_bricks).length,1==findLaneMarkers([unseen_bricks[unseen_bricks.length-1]]).length&&1==findLaneMarkers([R[0]]).length&&(num_unseen_markers-=1)):num_unseen_markers=0,[R,num_unseen_markers]}},{"./find-lane-markers.js":7,"./gen-first-wave-brick.js":9,"./gen-wave-brick.js":10}],15:[function(require,module,exports){"use strict";var parseWaveLane=require("./parse-wave-lane.js");module.exports=function(sig,lane){var content=[],tmp0=[];return sig.map((function(sigx){var parsed_wave_lane,num_unseen_markers,content_wave=null,current=[];content.push(current),lane.period=sigx.period||1,lane.phase=(sigx.phase?2*sigx.phase:0)+lane.xmin_cfg,tmp0[0]=sigx.name||" ",tmp0[1]=(sigx.phase||0)+lane.xmin_cfg/2,sigx.wave&&(content_wave=(parsed_wave_lane=parseWaveLane(sigx.wave,lane.period*lane.hscale-1,lane))[0],num_unseen_markers=parsed_wave_lane[1]),current.push(tmp0.slice(0),content_wave,function(e,num_unseen_markers){var ret_data;return void 0===(ret_data=e.data)?null:("string"==typeof ret_data&&(ret_data=ret_data.trim().split(/\s+/)),ret_data=ret_data.slice(num_unseen_markers))}(sigx,num_unseen_markers),sigx)})),content}},{"./parse-wave-lane.js":14}],16:[function(require,module,exports){"use strict";var eva=require("./eva.js"),appendSaveAsDialog=require("./append-save-as-dialog.js"),renderWaveForm=require("./render-wave-form.js");module.exports=function(){var points,i,index,notFirstSignal,obj,node0;for(index=0,points=document.querySelectorAll("*"),i=0;i<points.length;i++)points.item(i).type&&"WaveDrom"===points.item(i).type&&(points.item(i).setAttribute("id","InputJSON_"+index),(node0=document.createElement("div")).id="WaveDrom_Display_"+index,points.item(i).parentNode.insertBefore(node0,points.item(i)),index+=1);for(i=0;i<index;i+=1)obj=eva("InputJSON_"+i),renderWaveForm(i,obj,"WaveDrom_Display_",notFirstSignal),obj&&obj.signal&&!notFirstSignal&&(notFirstSignal=!0),appendSaveAsDialog(i,"WaveDrom_Display_");document.head.innerHTML+='<style type="text/css">div.wavedromMenu{position:fixed;border:solid 1pt#CCCCCC;background-color:white;box-shadow:0px 10px 20px #808080;cursor:default;margin:0px;padding:0px;}div.wavedromMenu>ul{margin:0px;padding:0px;}div.wavedromMenu>ul>li{padding:2px 10px;list-style:none;}div.wavedromMenu>ul>li:hover{background-color:#b5d5ff;}</style>'}},{"./append-save-as-dialog.js":1,"./eva.js":6,"./render-wave-form.js":29}],17:[function(require,module,exports){"use strict";module.exports=function rec(tmp,state){var i,name,old={},delta={x:10};for("string"!=typeof tmp[0]&&"number"!=typeof tmp[0]||(name=tmp[0],delta.x=25),state.x+=delta.x,i=0;i<tmp.length;i++)"object"==typeof tmp[i]&&("[object Array]"===Object.prototype.toString.call(tmp[i])?(old.y=state.y,(state=rec(tmp[i],state)).groups.push({x:state.xx,y:old.y,height:state.y-old.y,name:state.name})):(state.lanes.push(tmp[i]),state.width.push(state.x),state.y+=1));return state.xx=state.x,state.x-=delta.x,state.name=name,state}},{}],18:[function(require,module,exports){"use strict";var renderAssign=require("logidrom/lib/render-assign.js"),renderReg=require("./render-reg.js"),renderSignal=require("./render-signal.js");module.exports=function(index,source,waveSkin,notFirstSignal){var res=source.signal?renderSignal(index,source,waveSkin,notFirstSignal):source.assign?renderAssign(index,source):source.reg?renderReg(index,source):["div",{}];return res[1].class="WaveDrom",res}},{"./render-reg.js":26,"./render-signal.js":27,"logidrom/lib/render-assign.js":39}],19:[function(require,module,exports){"use strict";var arcShape=require("./arc-shape.js"),renderLabel=require("./render-label.js");function renderArc(Edge,from,to,shapeProps){return["path",{id:"gmark_"+Edge.from+"_"+Edge.to,d:shapeProps.d||"M "+from.x+","+from.y+" "+to.x+","+to.y,style:shapeProps.style||"fill:none;stroke:#00F;stroke-width:1"}]}module.exports=function(source,index,top,lane){var res=["g",{id:"wavearcs_"+index}],Events={};return Array.isArray(source)&&(source.map((function(element,i){var pos,eventname,stack,text=element.node;if(lane.period=element.period?element.period:1,lane.phase=(element.phase?2*element.phase:0)+lane.xmin_cfg,text)for(stack=text.split(""),pos=0;stack.length;)"."!==(eventname=stack.shift())&&(Events[eventname]={x:lane.xs*(2*pos*lane.period*lane.hscale-lane.phase)+lane.xlabel,y:i*lane.yo+lane.y0+.5*lane.ys}),pos+=1})),Array.isArray(top.edge)&&top.edge.map((function(element){var shapeProps,lx,ly,words=element.trim().split(/\s+/),Edge={words:words,label:element.substring(words[0].length).substring(1),from:words[0].substr(0,1),to:words[0].substr(-1,1),shape:words[0].slice(1,-1)},from=Events[Edge.from],to=Events[Edge.to];from&&to&&(lx=(shapeProps=arcShape(Edge,from,to)).lx,ly=shapeProps.ly,res=res.concat([renderArc(Edge,from,to,shapeProps)]),Edge.label&&(res=res.concat([renderLabel({x:lx,y:ly},Edge.label)])))})),Object.keys(Events).map((function(k){k===k.toLowerCase()&&Events[k].x>0&&(res=res.concat([renderLabel({x:Events[k].x,y:Events[k].y},k+"")]))}))),res}},{"./arc-shape.js":2,"./render-label.js":22}],20:[function(require,module,exports){"use strict";function renderGapUses(text,lane){for(var next,res=[],Stack=(text||"").split(""),pos=0,subCycle=!1;Stack.length;)"<"===(next=Stack.shift())&&(subCycle=!0,next=Stack.shift()),">"===next&&(subCycle=!1,next=Stack.shift()),pos+=subCycle?1:2*lane.period,"|"===next&&res.push(["use",{"xlink:href":"#gap",transform:"translate("+lane.xs*((pos-(subCycle?0:lane.period))*lane.hscale-lane.phase)+")"}]);return res}module.exports=function(source,index,lane){var i,gaps,res=[];if(source)for(i in source)lane.period=source[i].period?source[i].period:1,lane.phase=(source[i].phase?2*source[i].phase:0)+lane.xmin_cfg,gaps=renderGapUses(source[i].wave,lane),res=res.concat([["g",{id:"wavegap_"+i+"_"+index,transform:"translate(0,"+(lane.y0+i*lane.yo)+")"}].concat(gaps)]);return["g",{id:"wavegaps_"+index}].concat(res)}},{}],21:[function(require,module,exports){"use strict";var tspan=require("tspan");module.exports=function(groups,index,lane){var x,y,ts,res=["g"];return groups.forEach((function(e,i){res.push(["path",{id:"group_"+i+"_"+index,d:"m "+(e.x+.5)+","+(e.y*lane.yo+3.5+lane.yh0+lane.yh1)+" c -3,0 -5,2 -5,5 l 0,"+(e.height*lane.yo-16)+" c 0,3 2,5 5,5",style:"stroke:#0041c4;stroke-width:1;fill:none"}]),void 0!==e.name&&(x=e.x-10,y=lane.yo*(e.y+e.height/2)+lane.yh0+lane.yh1,(ts=tspan.parse(e.name)).unshift("text",{"text-anchor":"middle",class:"info","xml:space":"preserve"}),res.push(["g",{transform:"translate("+x+","+y+")"},["g",{transform:"rotate(270)"},ts]]))})),res}},{tspan:42}],22:[function(require,module,exports){"use strict";var tspan=require("tspan"),textWidth=require("./text-width.js");module.exports=function(p,text){var w=textWidth(text,8)+2;return["g",{transform:"translate("+p.x+","+p.y+")"},["rect",{x:-(w>>1),y:-5,width:w,height:10,style:"fill:#FFF;"}],["text",{"text-anchor":"middle",y:3,style:"font-size:8px;"}].concat(tspan.parse(text))]}},{"./text-width.js":31,tspan:42}],23:[function(require,module,exports){"use strict";var renderMarks=require("./render-marks.js"),renderArcs=require("./render-arcs.js"),renderGaps=require("./render-gaps.js");module.exports=function(index,content,waveLanes,ret,source,lane){return[renderMarks(content,index,lane,source)].concat(waveLanes.res).concat([renderArcs(ret.lanes,index,source,lane)]).concat([renderGaps(ret.lanes,index,lane)])}},{"./render-arcs.js":19,"./render-gaps.js":20,"./render-marks.js":24}],24:[function(require,module,exports){"use strict";var tspan=require("tspan");function captext(cxt,anchor,y){return cxt[anchor]&&cxt[anchor].text?[["text",{x:cxt.xmax*cxt.xs/2,y:y,fill:"#000","text-anchor":"middle","xml:space":"preserve"}].concat(tspan.parse(cxt[anchor].text))]:[]}function ticktock(cxt,ref1,ref2,x,dx,y,len){var offset,val,tmp,i,step=1,dp=0,L=[];if(void 0===cxt[ref1]||void 0===cxt[ref1][ref2])return[];if("string"==typeof(val=cxt[ref1][ref2]))val=val.trim().split(/\s+/);else if("number"==typeof val||"boolean"==typeof val)for(offset=Number(val),val=[],i=0;i<len;i+=1)val.push(i+offset);if("[object Array]"!==Object.prototype.toString.call(val))return[];if(0===val.length)return[];if(1===val.length)if(offset=Number(val[0]),isNaN(offset))L=val;else for(i=0;i<len;i+=1)L[i]=i+offset;else if(2===val.length)if(offset=Number(val[0]),step=Number(val[1]),2===(tmp=val[1].split(".")).length&&(dp=tmp[1].length),isNaN(offset)||isNaN(step))L=val;else for(offset*=step,i=0;i<len;i+=1)L[i]=(step*i+offset).toFixed(dp);else L=val;var res=["g",{class:"muted","text-anchor":"middle","xml:space":"preserve"}];for(i=0;i<len;i+=1)res.push(["text",{x:i*dx+x,y:y}].concat(tspan.parse(L[i])));return[res]}module.exports=function(content,index,lane,source){var i,mstep=2*lane.hscale,mmstep=mstep*lane.xs,marks=lane.xmax/mstep,gy=content.length*lane.yo,res=["g",{id:"gmarks_"+index}],gmarkLines=["g",{style:"stroke:#888;stroke-width:0.5;stroke-dasharray:1,3"}];if(!source||!source.config||!1!==source.config.marks){for(i=0;i<marks+1;i+=1)gmarkLines.push(["line",{id:"gmark_"+i+"_"+index,x1:i*mmstep,y1:0,x2:i*mmstep,y2:gy}]);res=res.concat([gmarkLines])}return res.concat(captext(lane,"head",lane.yh0?-33:-13)).concat(captext(lane,"foot",gy+(lane.yf0?45:25))).concat(ticktock(lane,"head","tick",0,mmstep,-5,marks+1)).concat(ticktock(lane,"head","tock",mmstep/2,mmstep,-5,marks)).concat(ticktock(lane,"foot","tick",0,mmstep,gy+15,marks+1)).concat(ticktock(lane,"foot","tock",mmstep/2,mmstep,gy+15,marks))}},{tspan:42}],25:[function(require,module,exports){"use strict";var colors={1:"#000000",2:"#e90000",3:"#3edd00",4:"#0074cd",5:"#ff15db",6:"#af9800",7:"#00864f",8:"#a076ff"};module.exports=function(el,key,lane){var color,start,xs=lane.xs,ys=lane.ys,period=2*(el.period||1)*xs,xoffset=2*-(el.phase||0)*xs,y="under"===key?ys:0;function line(x){return void 0===start?[]:[["line",{style:"stroke:"+color,x1:period*start+12,x2:period*x}]]}if(el[key]){var res=["g",{transform:"translate("+xoffset+","+y+")",style:"stroke-width:3"}];const arr=el[key].split("");return arr.map((function(dot,i){"."!==dot&&void 0!==start&&(res=res.concat(line(i)),"over"===key&&res.push(["path",{style:"stroke:none;fill:"+color,d:"m"+(period*i-7)+" 0 l7 7 v-7 z"}])),"0"===dot?start=void 0:"."!==dot&&(start=i,color=colors[dot]||colors[1])})),void 0!==start&&(res=res.concat(line(arr.length))),[res]}return[]}},{}],26:[function(require,module,exports){"use strict";var render=require("bit-field/lib/render.js");module.exports=function(index,source){return render(source.reg,source.config)}},{"bit-field/lib/render.js":34}],27:[function(require,module,exports){"use strict";var rec=require("./rec.js"),lane=require("./lane.js"),parseConfig=require("./parse-config.js"),parseWaveLanes=require("./parse-wave-lanes.js"),renderGroups=require("./render-groups.js"),renderLanes=require("./render-lanes.js"),renderWaveLane=require("./render-wave-lane.js"),insertSVGTemplate=require("./insert-svg-template.js");module.exports=function(index,source,waveSkin,notFirstSignal){!function(index,source,lane,waveSkin){if(0===index){var first,skin,socket;for(first in waveSkin)break;skin=waveSkin.default||waveSkin[first],source&&source.config&&source.config.skin&&waveSkin[source.config.skin]&&(skin=waveSkin[source.config.skin]),socket=skin[3][1][2][1],lane.xs=Number(socket.width),lane.ys=Number(socket.height),lane.xlabel=Number(socket.x),lane.ym=Number(socket.y)}}(index,source,lane,waveSkin),parseConfig(source,lane);var ret=rec(source.signal,{x:0,y:0,xmax:0,width:[],lanes:[],groups:[]}),content=parseWaveLanes(ret.lanes,lane),waveLanes=renderWaveLane(content,index,lane),waveGroups=renderGroups(ret.groups,index,lane),xmax=waveLanes.glengths.reduce((function(res,len,i){return Math.max(res,len+ret.width[i])}),0);return lane.xg=Math.ceil((xmax-lane.tgo)/lane.xs)*lane.xs,insertSVGTemplate(index,source,lane,waveSkin,content,renderLanes(index,content,waveLanes,ret,source,lane),waveGroups,notFirstSignal)}},{"./insert-svg-template.js":11,"./lane.js":12,"./parse-config.js":13,"./parse-wave-lanes.js":15,"./rec.js":17,"./render-groups.js":21,"./render-lanes.js":23,"./render-wave-lane.js":30}],28:[function(require,module,exports){"use strict";var renderAny=require("./render-any.js"),createElement=require("./create-element.js");module.exports=function(index,source,outputElement,waveSkin,notFirstSignal){for(;outputElement.childNodes.length;)outputElement.removeChild(outputElement.childNodes[0]);outputElement.insertBefore(createElement(renderAny(index,source,waveSkin,notFirstSignal)),null)}},{"./create-element.js":4,"./render-any.js":18}],29:[function(require,module,exports){"use strict";var renderWaveElement=require("./render-wave-element.js");module.exports=function(index,source,output,notFirstSignal){renderWaveElement(index,source,document.getElementById(output+index),window.WaveSkin,notFirstSignal)}},{"./render-wave-element.js":28}],30:[function(require,module,exports){"use strict";var tspan=require("tspan"),textWidth=require("./text-width.js"),findLaneMarkers=require("./find-lane-markers.js"),renderOverUnder=require("./render-over-under.js");function renderLaneUses(cont,lane){var res=[],labels=[];return cont[1]&&(cont[1].map((function(ref,i){res.push(["use",{"xlink:href":"#"+ref,transform:"translate("+i*lane.xs+")"}])})),cont[2]&&cont[2].length&&(labels=findLaneMarkers(cont[1])).length&&labels.map((function(label,i){cont[2]&&void 0!==cont[2][i]&&res.push(["text",{x:label*lane.xs+lane.xlabel,y:lane.ym,"text-anchor":"middle","xml:space":"preserve"}].concat(tspan.parse(cont[2][i])))}))),res}module.exports=function(content,index,lane){var xmax=0,glengths=[],res=[];return content.map((function(el,j){var name=el[0][0];if(name){var xoffset=el[0][1];xoffset=xoffset>0?Math.ceil(2*xoffset)-2*xoffset:-2*xoffset,res.push(["g",{id:"wavelane_"+j+"_"+index,transform:"translate(0,"+(lane.y0+j*lane.yo)+")"}].concat([["text",{x:lane.tgo,y:lane.ym,class:"info","text-anchor":"end","xml:space":"preserve"}].concat(tspan.parse(name))]).concat([["g",{id:"wavelane_draw_"+j+"_"+index,transform:"translate("+xoffset*lane.xs+", 0)"}].concat(renderLaneUses(el,lane))]).concat(renderOverUnder(el[3],"over",lane),renderOverUnder(el[3],"under",lane))),xmax=Math.max(xmax,(el[1]||[]).length),glengths.push(textWidth(name,11))}})),lane.xmax=Math.min(xmax,lane.xmax_cfg-lane.xmin_cfg),lane.xg=20,{glengths:glengths,res:res}}},{"./find-lane-markers.js":7,"./render-over-under.js":25,"./text-width.js":31,tspan:42}],31:[function(require,module,exports){"use strict";var charWidth=require("./char-width.json");module.exports=function(str,size){var i,len,c,w,width;for(size=size||11,len=str.length,width=0,i=0;i<len;i++)c=str.charCodeAt(i),void 0===(w=charWidth.chars[c])&&(w=charWidth.other),width+=w;return width*size/100}},{"./char-width.json":3}],32:[function(require,module,exports){"use strict";module.exports={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/XML/1998/namespace"}},{}],33:[function(require,module,exports){"use strict";window.WaveDrom=window.WaveDrom||{};var pkg=require("../package.json"),processAll=require("./process-all.js"),eva=require("./eva.js"),renderWaveForm=require("./render-wave-form.js"),editorRefresh=require("./editor-refresh.js");window.WaveDrom.ProcessAll=processAll,window.WaveDrom.RenderWaveForm=renderWaveForm,window.WaveDrom.EditorRefresh=editorRefresh,window.WaveDrom.eva=eva,window.WaveDrom.version=pkg.version},{"../package.json":45,"./editor-refresh.js":5,"./eva.js":6,"./process-all.js":16,"./render-wave-form.js":29}],34:[function(require,module,exports){"use strict";const tspan=require("tspan"),round=Math.round,tt=(x,y,obj)=>Object.assign({transform:"translate("+x+(y?","+y:"")+")"},"object"==typeof obj?obj:{}),colors={2:0,3:80,4:170,5:45,6:126,7:215},norm=(obj,other)=>Object.assign(Object.keys(obj).reduce((prev,key)=>{const val=Number(obj[key]),valInt=isNaN(val)?0:Math.round(val);return 0!==valInt&&(prev[key]=valInt),prev},{}),other),text=(body,x,y)=>["text",norm({x:x,y:y})].concat(tspan.parse(body)),hline=(len,x,y)=>["line",norm({x1:x,x2:x+len,y1:y,y2:y})],vline=(len,x,y)=>["line",norm({x1:x,x2:x,y1:y,y2:y+len})],getLabel=(val,x,y,step,len)=>{if("number"!=typeof val)return text(val,x,y);const res=["g",{}];for(let i=0;i<len;i++)res.push(text(val>>i&1,x+step*(len/2-i-.5),y));return res},labelArr=(desc,opt)=>{const{margin:margin,hspace:hspace,vspace:vspace,mod:mod,index:index,fontsize:fontsize,vflip:vflip,compact:compact}=opt,width=hspace-margin.left-margin.right-1,height=vspace-margin.top-margin.bottom,step=width/mod,blanks=["g"],bits=["g",tt(round(step/2),-3)],names=["g",tt(round(step/2),round(height/2+fontsize/3))],attrs=["g",tt(round(step/2),round(height+fontsize-1))];return desc.map(e=>{let lsbm=0,msbm=mod-1,lsb=index*mod,msb=(index+1)*mod-1;if(e.lsb/mod>>0===index)lsbm=e.lsbm,lsb=e.lsb,e.msb/mod>>0===index&&(msb=e.msb,msbm=e.msbm);else if(e.msb/mod>>0===index)msb=e.msb,msbm=e.msbm;else if(!(lsb>e.lsb&&msb<e.msb))return;var t;compact||(bits.push(text(lsb,step*(vflip?lsbm:mod-lsbm-1))),lsbm!==msbm&&bits.push(text(msb,step*(vflip?msbm:mod-msbm-1)))),e.name&&names.push(getLabel(e.name,step*(vflip?(msbm+lsbm)/2:mod-(msbm+lsbm)/2-1),0,step,e.bits)),void 0!==e.name&&void 0===e.type||blanks.push(["rect",norm({x:step*(vflip?lsbm:mod-msbm-1),width:step*(msbm-lsbm+1),height:height},{style:"fill-opacity:0.1"+(t=e.type,void 0!==colors[t]?";fill:hsl("+colors[t]+",100%,50%)":"")})]),void 0!==e.attr&&attrs.push(((e,opt,step,lsbm,msbm)=>{const x=opt.vflip?step*((msbm+lsbm)/2):step*(opt.mod-(msbm+lsbm)/2-1);return Array.isArray(e.attr)?e.attr.reduce((prev,a,i)=>null==a?prev:prev.concat([getLabel(a,x,opt.fontsize*i,step,e.bits)]),["g",{}]):getLabel(e.attr,x,0,step,e.bits)})(e,opt,step,lsbm,msbm))}),["g",blanks,bits,names,attrs]},cage=(desc,opt)=>{const{hspace:hspace,vspace:vspace,mod:mod,margin:margin,index:index,vflip:vflip}=opt,width=hspace-margin.left-margin.right-1,height=vspace-margin.top-margin.bottom,res=["g",{stroke:"black","stroke-width":1,"stroke-linecap":"round"},hline(width,0,0),vline(height,vflip?width:0,0),hline(width,0,height)];let i=index*mod;const delta=vflip?1:-1;let j=vflip?0:mod;for(let k=0;k<mod;k++){const xj=j*(width/mod);0===k||desc.some(e=>e.lsb===i)?res.push(vline(height,xj,0)):(res.push(vline(height>>>3,xj,0)),res.push(vline(-(height>>>3),xj,height))),i++,j+=delta}return res},lane=(desc,opt)=>{const{index:index,vspace:vspace,margin:margin,fontsize:fontsize,hflip:hflip,lanes:lanes,compact:compact}=opt,height=vspace-margin.top-margin.bottom;let tx=margin.left;const idx=hflip?index:lanes-index-1;let ty=round(idx*vspace+margin.top);compact&&(ty=round(idx*height+margin.top));const res=["g",tt(tx,ty),cage(desc,opt),labelArr(desc,opt)];return compact&&res.push(["g",{"text-anchor":"end"},text(index,-4,round(height/2+fontsize/3))]),res};module.exports=(desc,opt)=>{[["hspace",40,800],["lanes",1,1],["bits",1,32],["fontsize",6,14]].map((opt=>row=>{const[key,min,def]=row,val=Math.round(opt[key]);opt[key]="number"==typeof val&&val>=min?val:def})(opt="object"==typeof opt?opt:{}));const maxAttributes=(desc=>desc.reduce((prev,field)=>Math.max(prev,void 0===field.attr?0:Array.isArray(field.attr)?field.attr.length:1),0))(desc);opt.vspace=opt.vspace||(maxAttributes+3)*opt.fontsize,opt.fontfamily=opt.fontfamily||"sans-serif",opt.fontweight=opt.fontweight||"normal",opt.compact=opt.compact||!1,opt.hflip=opt.hflip||!1,opt.margin=opt.margin||{};const{hspace:hspace,vspace:vspace,lanes:lanes,margin:margin,compact:compact,fontsize:fontsize,bits:bits}=opt;void 0===margin.right&&(margin.right=4),void 0===margin.left&&(margin.left=compact?32:margin.right),void 0===margin.top?(margin.top=fontsize,void 0===margin.bottom&&(margin.bottom=fontsize*maxAttributes+2)):void 0===margin.bottom&&(margin.bottom=margin.top);let width=hspace,height=vspace*lanes;compact&&(height-=(lanes-1)*(margin.top+margin.bottom));const res=["g",tt(.5,.5,{"text-anchor":"middle","font-size":opt.fontsize,"font-family":opt.fontfamily,"font-weight":opt.fontweight})];let lsb=0;const mod=bits/lanes;opt.mod=0|mod,desc.map(e=>{e.lsb=lsb,e.lsbm=lsb%mod,lsb+=e.bits,e.msb=lsb-1,e.msbm=e.msb%mod});for(let i=0;i<lanes;i++)opt.index=i,res.push(lane(desc,opt));return compact&&res.push(((desc,opt)=>{const{hspace:hspace,margin:margin,mod:mod,fontsize:fontsize,vflip:vflip}=opt,step=(hspace-margin.left-margin.right-1)/mod,labels=["g",tt(margin.left,-3)];for(let i=0;i<mod;i++)labels.push(text(vflip?i:mod-i-1,step*(i+.5),fontsize));return labels})(0,opt)),(w=width,h=height,["svg",{xmlns:"http://www.w3.org/2000/svg",width:w,height:h,viewBox:[0,0,w,h].join(" ")}]).concat([res]);var w,h}},{tspan:42}],35:[function(require,module,exports){"use strict";var tspan=require("tspan");module.exports=function(type,ymin,ymax){var e,iecs,circle=" M 4,0 C 4,1.1 3.1,2 2,2 0.9,2 0,1.1 0,0 c 0,-1.1 0.9,-2 2,-2 1.1,0 2,0.9 2,2 z";return ymax===ymin&&(ymax=4,ymin=-4),iecs={BUF:1,INV:1,AND:"&",NAND:"&",OR:"≥1",NOR:"≥1",XOR:"=1",XNOR:"=1",box:""}[type],(e={"~":"M -11,-6 -11,6 0,0 z m -5,6 5,0"+circle,"=":"M -11,-6 -11,6 0,0 z m -5,6 5,0","&":"m -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z","~&":"m -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z"+circle,"|":"m -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z","~|":"m -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z"+circle,"^":"m -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z","~^":"m -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z"+circle,"+":"m -8,5 0,-10 m -5,5 10,0 m 3,0 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z","*":"m -4,4 -8,-8 m 0,8 8,-8 m 4,4 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z"}[type])?["path",{class:"gate",d:e}]:iecs?["g",["path",{class:"gate",d:"m -16,"+(ymin-3)+" 16,0 0,"+(ymax-ymin+6)+" -16,0 z"+({INV:1,NAND:1,NOR:1,XNOR:1}[type]?circle:"")}],["text",{x:"-14",y:"4",class:"wirename"}].concat(tspan.parse(iecs))]:["text",{x:"-14",y:"4",class:"wirename"}].concat(tspan.parse(type))}},{tspan:42}],36:[function(require,module,exports){"use strict";var tspan=require("tspan"),drawGate=require("./draw_gate");module.exports=function drawBoxes(tree,xmax){var i,ilen,fx,fy,fname,ret=["g"],spec=[];if("[object Array]"===Object.prototype.toString.call(tree)){for(ilen=tree.length,spec.push(tree[0].name),spec.push([32*(xmax-tree[0].x),8*tree[0].y]),i=1;i<ilen;i++)"[object Array]"===Object.prototype.toString.call(tree[i])?spec.push([32*(xmax-tree[i][0].x),8*tree[i][0].y]):spec.push([32*(xmax-tree[i].x),8*tree[i].y]);for(ret.push(drawGate(spec)),i=1;i<ilen;i++)ret.push(drawBoxes(tree[i],xmax))}else fname=tree.name,fx=32*(xmax-tree.x),fy=8*tree.y,ret.push(["g",{transform:"translate("+fx+","+fy+")"},["title"].concat(tspan.parse(fname)),["path",{d:"M 2,0 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"}],["text",{x:"-4",y:"4",class:"pinname"}].concat(tspan.parse(fname))]);return ret}},{"./draw_gate":37,tspan:42}],37:[function(require,module,exports){"use strict";var tspan=require("tspan"),drawBody=require("./draw_body");module.exports=function(spec){var i,ymin,ymax,ret=["g"],ys=[],ilen=spec.length;for(i=2;i<ilen;i++)ys.push(spec[i][1]);for(ymin=Math.min.apply(null,ys),ymax=Math.max.apply(null,ys),ret.push(["g",{transform:"translate(16,0)"},["path",{d:"M "+spec[2][0]+","+ymin+" "+spec[2][0]+","+ymax,class:"wire"}]]),i=2;i<ilen;i++)ret.push(["g",["path",{d:"m "+spec[i][0]+","+spec[i][1]+" 16,0",class:"wire"}]]);return ret.push(["g",{transform:"translate("+spec[1][0]+","+spec[1][1]+")"},["title"].concat(tspan.parse(spec[0])),drawBody(spec[0],ymin-spec[1][1],ymax-spec[1][1])]),ret}},{"./draw_body":35,tspan:42}],38:[function(require,module,exports){"use strict";module.exports=function(){return["style",".pinname {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:end; font-family:Helvetica} .wirename {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:start; font-family:Helvetica} .wirename:hover {fill:blue} .gate {color:#000; fill:#ffc; fill-opacity: 1;stroke:#000; stroke-width:1; stroke-opacity:1} .gate:hover {fill:red; } .wire {fill:none; stroke:#000; stroke-width:1; stroke-opacity:1} .grid {fill:#fff; fill-opacity:1; stroke:none}"]}},{}],39:[function(require,module,exports){"use strict";var render=require("./render"),drawBoxes=require("./draw_boxes"),insertSVGTemplateAssign=require("./insert-svg-template-assign.js");module.exports=function(index,source){var tree,state,xmax,width,height,i,ilen,j,jlen,svg=["g"],grid=["g"];for(ilen=source.assign.length,state={x:0,y:2,xmax:0},tree=source.assign,i=0;i<ilen;i++)(state=render(tree[i],state)).x++;for(xmax=state.xmax+3,i=0;i<ilen;i++)svg.push(drawBoxes(tree[i],xmax));for(width=32*(xmax+1)+1,height=8*(state.y+1)-7,ilen=4*(xmax+1),jlen=state.y+1,i=0;i<=ilen;i++)for(j=0;j<=jlen;j++)grid.push(["rect",{height:1,width:1,x:8*i-.5,y:8*j-.5,class:"grid"}]);return["svg",{id:"svgcontent_"+index,viewBox:"0 0 "+width+" "+height,width:width,height:height},insertSVGTemplateAssign(),["g",{transform:"translate(0.5, 0.5)"},grid,svg]]}},{"./draw_boxes":36,"./insert-svg-template-assign.js":38,"./render":40}],40:[function(require,module,exports){"use strict";module.exports=function render(tree,state){var y,i,ilen;for(state.xmax=Math.max(state.xmax,state.x),y=state.y,ilen=tree.length,i=1;i<ilen;i++)"[object Array]"===Object.prototype.toString.call(tree[i])?state=render(tree[i],{x:state.x+1,y:state.y,xmax:state.xmax}):(tree[i]={name:tree[i],x:state.x+1,y:state.y},state.y+=2);return tree[0]={name:tree[0],x:state.x,y:Math.round((y+(state.y-2))/2)},state.x--,state}},{}],41:[function(require,module,exports){"use strict";module.exports=function(a,indentation){var cr="",indent=function(t){return t};return indentation>0&&(cr="\n",indent=function(indentation){var space=" ".repeat(indentation);return function(txt){var arr,res=[];return"string"!=typeof txt?txt:1===(arr=txt.split("\n")).length?space+txt:(arr.forEach((function(e){""!==e.trim()?res.push(space+e):res.push(e)})),res.join("\n"))}}(indentation)),function rec(a){var res,body,isFlat;return body="",isFlat=!0,a.some((function(e,i,arr){if(0===i)return res="<"+e,1===arr.length||void 0;if(1===i){if((o=e)&&"[object Object]"===Object.prototype.toString.call(o))return Object.keys(e).forEach((function(key){res+=" "+key+'="'+e[key]+'"'})),2===arr.length||void(res+=">");res+=">"}var o;switch(typeof e){case"string":case"number":case"boolean":case"undefined":return void(body+=e+cr)}isFlat=!1,body+=rec(e)}))?res+"/>"+cr:isFlat?res+function(txt){var arr=txt.split("\n"),res=[];return arr.forEach((function(e){""!==e.trim()&&res.push(e)})),res.join("\n")}(body)+"</"+a[0]+">"+cr:res+cr+indent(body)+"</"+a[0]+">"+cr}(a)}},{}],42:[function(require,module,exports){"use strict";var parse=require("./parse"),reparse=require("./reparse");exports.parse=parse,exports.reparse=reparse},{"./parse":43,"./reparse":44}],43:[function(require,module,exports){"use strict";var escapeMap={"&":"&",'"':""","<":"<",">":">"};function xscape(val){return"string"!=typeof val?val:val.replace(/([&"<>])/g,(function(_,e){return escapeMap[e]}))}var token=/<o>|<ins>|<s>|<sub>|<sup>|<b>|<i>|<tt>|<\/o>|<\/ins>|<\/s>|<\/sub>|<\/sup>|<\/b>|<\/i>|<\/tt>/;function update(s,cmd){cmd.add&&cmd.add.split(";").forEach((function(e){var arr=e.split(" ");s[arr[0]][arr[1]]=!0})),cmd.del&&cmd.del.split(";").forEach((function(e){var arr=e.split(" ");delete s[arr[0]][arr[1]]}))}var trans={"<o>":{add:"text-decoration overline"},"</o>":{del:"text-decoration overline"},"<ins>":{add:"text-decoration underline"},"</ins>":{del:"text-decoration underline"},"<s>":{add:"text-decoration line-through"},"</s>":{del:"text-decoration line-through"},"<b>":{add:"font-weight bold"},"</b>":{del:"font-weight bold"},"<i>":{add:"font-style italic"},"</i>":{del:"font-style italic"},"<sub>":{add:"baseline-shift sub;font-size .7em"},"</sub>":{del:"baseline-shift sub;font-size .7em"},"<sup>":{add:"baseline-shift super;font-size .7em"},"</sup>":{del:"baseline-shift super;font-size .7em"},"<tt>":{add:"font-family monospace"},"</tt>":{del:"font-family monospace"}};function dump(s){return Object.keys(s).reduce((function(pre,cur){var keys=Object.keys(s[cur]);return keys.length>0&&(pre[cur]=keys.join(" ")),pre}),{})}module.exports=function(str){var state,res,i,m,a;if(void 0===str)return[];if("number"==typeof str)return[str+""];if("string"!=typeof str)return[str];for(res=[],state={"text-decoration":{},"font-weight":{},"font-style":{},"baseline-shift":{},"font-size":{},"font-family":{}};;){if(-1===(i=str.search(token)))return res.push(["tspan",dump(state),xscape(str)]),res;if(i>0&&(a=str.slice(0,i),res.push(["tspan",dump(state),xscape(a)])),m=str.match(token)[0],update(state,trans[m]),0===(str=str.slice(i+m.length)).length)return res}}},{}],44:[function(require,module,exports){"use strict";var parse=require("./parse");module.exports=function(React){var $=React.createElement;function reTspan(e,i){var tag=e[0],attr=e[1],newAttr=Object.keys(attr).reduce((function(res,key){var str,m;return res[null===(m=(str=key).match(/(\w+)-(\w)(\w+)/))?str:m[1]+m[2].toUpperCase()+m[3]]=attr[key],res}),{}),body=e[2];return newAttr.key=i,$(tag,newAttr,body)}return function(str){return parse(str).map(reTspan)}}},{"./parse":43}],45:[function(require,module,exports){module.exports={name:"wavedrom",version:"2.6.7",description:"Digital timing diagram in your browser",homepage:"http://wavedrom.com",author:"[email protected]",license:"MIT",repository:{type:"git",url:"https://github.com/wavedrom/wavedrom.git"},bugs:{url:"https://github.com/wavedrom/wavedrom/issues"},main:"./lib",unpkg:"wavedrom.unpkg.min.js",files:["bin/cli.js","wavedrom.js","wavedrom.min.js","wavedrom.unpkg.js","wavedrom.unpkg.min.js","LICENSE","lib/**","skins/**"],scripts:{test:"npm-run-all eslint nyc",eslint:"eslint lib/*.js",nyc:"nyc -r=lcov -r=text mocha test",dist:"browserify ./lib/wave-drom.js > wavedrom.js","dist.min":"terser --compress --mengle -- wavedrom.js | node ./bin/header.js > wavedrom.min.js",unpkg:"browserify --standalone wavedrom lib/index.js > wavedrom.unpkg.js","unpkg.min":"terser --compress --mengle -- wavedrom.unpkg.js | node ./bin/header.js > wavedrom.unpkg.min.js",cli:"{ echo '#!/usr/bin/env node' ; browserify --node bin/cli.js ; } > bin/wavedrom.js ; chmod +x bin/wavedrom.js",prepare:"npm-run-all test dist dist.min unpkg unpkg.min",coverage:"nyc report -r=text-lcov | coveralls",clean:"rm -rf wavedrom.js wavedrom.*.js coverage .nyc_output",skins:"for S in default narrow dark lowkey ; do node bin/svg2js.js -i unpacked/skins/$S.svg > skins/$S.js ; done"},keywords:["waveform","verilog","RTL"],devDependencies:{"@drom/eslint-config":"^0.10.0",browserify:"^16.5.1",chai:"^4.2.0",coveralls:"^3.1.0",eslint:"^6.8.0","fs-extra":"^8.1.0",json5:"^2.1.3",mocha:"^7.1.2","npm-run-all":"^4.1.5",nyc:"^15.0.1",terser:"^4.6.13",yargs:"^15.3.1"},dependencies:{"bit-field":"^1.3.5",logidrom:"^0.2.1",onml:"^1.2.0",tspan:"^0.4.0"},eslintConfig:{extends:"@drom/eslint-config/eslint4/node4",rules:{camelcase:0}}}},{}]},{},[33]);