diff --git a/static/js/app.js b/static/js/app.js index a81e80aa8..5179e1614 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1,2 +1,2 @@ /*! For license information please see app.js.LICENSE.txt */ -(()=>{var e,t={2835:(e,t,n)=>{"use strict";var i={};n.r(i),n.d(i,{attentionMarkers:()=>Qo,contentInitial:()=>jo,disable:()=>Zo,document:()=>Uo,flow:()=>qo,flowInitial:()=>$o,insideSpan:()=>Yo,string:()=>Ko,text:()=>Go});var o={};n.r(o),n.d(o,{boolean:()=>fa,booleanish:()=>ma,commaOrSpaceSeparated:()=>Ca,commaSeparated:()=>ya,number:()=>va,overloadedBoolean:()=>_a,spaceSeparated:()=>ba});var r={};n.r(r),n.d(r,{aggregate:()=>Jb,bin:()=>ey,collect:()=>ny,compare:()=>iy,countpattern:()=>ry,cross:()=>sy,density:()=>cy,dotbin:()=>py,expression:()=>fy,extent:()=>_y,facet:()=>by,field:()=>yy,filter:()=>wy,flatten:()=>Sy,fold:()=>xy,formula:()=>ky,generate:()=>Ey,impute:()=>Dy,joinaggregate:()=>Ty,kde:()=>Ay,key:()=>Iy,load:()=>My,lookup:()=>Py,multiextent:()=>Fy,multivalues:()=>zy,params:()=>Wy,pivot:()=>Vy,prefacet:()=>Uy,project:()=>jy,proxy:()=>$y,quantile:()=>qy,relay:()=>Ky,sample:()=>Gy,sequence:()=>Yy,sieve:()=>Qy,subflow:()=>vy,timeunit:()=>Zy,tupleindex:()=>Jy,values:()=>eC,window:()=>rC});var s={};n.r(s),n.d(s,{interpolate:()=>OS,interpolateArray:()=>kS,interpolateBasis:()=>gS,interpolateBasisClosed:()=>pS,interpolateCubehelix:()=>mk,interpolateCubehelixLong:()=>_k,interpolateDate:()=>NS,interpolateDiscrete:()=>wx,interpolateHcl:()=>nk,interpolateHclLong:()=>ik,interpolateHsl:()=>Mx,interpolateHslLong:()=>Rx,interpolateHue:()=>Sx,interpolateLab:()=>ek,interpolateNumber:()=>LS,interpolateNumberArray:()=>SS,interpolateObject:()=>DS,interpolateRgb:()=>bS,interpolateRgbBasis:()=>CS,interpolateRgbBasisClosed:()=>wS,interpolateRound:()=>MS,interpolateString:()=>IS,interpolateTransformCss:()=>Dx,interpolateTransformSvg:()=>Tx,interpolateZoom:()=>Ix,piecewise:()=>bx,quantize:()=>vk});var a={};n.r(a),n.d(a,{bound:()=>MA,identifier:()=>FA,mark:()=>BA,overlap:()=>zA,render:()=>qA,viewlayout:()=>gI});var l={};n.r(l),n.d(l,{axisticks:()=>fI,datajoin:()=>mI,encode:()=>vI,legendentries:()=>bI,linkpath:()=>xI,pie:()=>DI,scale:()=>II,sortitems:()=>PI,stack:()=>WI});var c={};n.r(c),n.d(c,{contour:()=>bP,geojson:()=>wP,geopath:()=>SP,geopoint:()=>xP,geoshape:()=>kP,graticule:()=>EP,heatmap:()=>NP,isocontour:()=>cP,kde2d:()=>mP,projection:()=>DP});var u={};n.r(u),n.d(u,{force:()=>xF});var h={};n.r(h),n.d(h,{nest:()=>xB,pack:()=>TB,partition:()=>IB,stratify:()=>OB,tree:()=>PB,treelinks:()=>FB,treemap:()=>HB});var d={};n.r(d),n.d(d,{label:()=>lz});var g={};n.r(g),n.d(g,{loess:()=>uz,regression:()=>dz});var p={};n.r(p),n.d(p,{voronoi:()=>Rz});var f={};n.r(f),n.d(f,{wordcloud:()=>Yz});var m={};n.r(m),n.d(m,{crossfilter:()=>nH,resolvefilter:()=>iH});var _={};n.r(_),n.d(_,{Bounds:()=>TN,CanvasHandler:()=>aT,CanvasRenderer:()=>dT,DATE:()=>Op,DAY:()=>Mp,DAYOFYEAR:()=>Rp,Dataflow:()=>Dv,Debug:()=>Mh,Error:()=>Ah,EventStream:()=>fv,Gradient:()=>FE,GroupItem:()=>IN,HOURS:()=>Pp,Handler:()=>UD,Info:()=>Oh,Item:()=>AN,MILLISECONDS:()=>zp,MINUTES:()=>Fp,MONTH:()=>Ap,Marks:()=>ND,MultiPulse:()=>kv,None:()=>Th,Operator:()=>dv,Parameters:()=>cv,Pulse:()=>Cv,QUARTER:()=>Tp,RenderType:()=>JT,Renderer:()=>$D,ResourceLoader:()=>ON,SECONDS:()=>Bp,SVGHandler:()=>pT,SVGRenderer:()=>BT,SVGStringRenderer:()=>XT,Scenegraph:()=>RD,TIME_UNITS:()=>Hp,Transform:()=>Av,View:()=>aj,WEEK:()=>Ip,Warn:()=>Ih,YEAR:()=>Dp,accessor:()=>ph,accessorFields:()=>mh,accessorName:()=>fh,array:()=>ad,ascending:()=>hd,bandwidthNRD:()=>qv,bin:()=>Kv,bootstrapCI:()=>Qv,boundClip:()=>aA,boundContext:()=>eL,boundItem:()=>LD,boundMark:()=>TD,boundStroke:()=>PN,changeset:()=>av,clampRange:()=>ld,codegenExpression:()=>uW,compare:()=>ud,constant:()=>fd,cumulativeLogNormal:()=>hb,cumulativeNormal:()=>rb,cumulativeUniform:()=>_b,dayofyear:()=>Kp,debounce:()=>md,defaultLocale:()=>y_,definition:()=>Ov,densityLogNormal:()=>ub,densityNormal:()=>ob,densityUniform:()=>mb,domChild:()=>zD,domClear:()=>HD,domCreate:()=>FD,domFind:()=>BD,dotbin:()=>Zv,error:()=>yh,expressionFunction:()=>cU,extend:()=>_d,extent:()=>vd,extentIndex:()=>bd,falsy:()=>Lh,fastmap:()=>Sd,field:()=>wh,flush:()=>xd,font:()=>bD,fontFamily:()=>vD,fontSize:()=>gD,format:()=>U_,formatLocale:()=>d_,formats:()=>j_,hasOwnProperty:()=>Cd,id:()=>Sh,identity:()=>xh,inferType:()=>P_,inferTypes:()=>F_,ingest:()=>tv,inherits:()=>kd,inrange:()=>Ed,interpolate:()=>lE,interpolateColors:()=>rE,interpolateRange:()=>oE,intersect:()=>nA,intersectBoxLine:()=>hL,intersectPath:()=>aL,intersectPoint:()=>lL,intersectRule:()=>uL,isArray:()=>Ph,isBoolean:()=>Nd,isDate:()=>Ld,isFunction:()=>cd,isIterable:()=>Dd,isNumber:()=>Td,isObject:()=>Fh,isRegExp:()=>Ad,isString:()=>Id,isTuple:()=>X_,key:()=>Od,lerp:()=>Md,lineHeight:()=>pD,loader:()=>K_,locale:()=>b_,logger:()=>Rh,lruCache:()=>Rd,markup:()=>AT,merge:()=>Pd,mergeConfig:()=>zh,multiLineOffset:()=>mD,one:()=>Eh,pad:()=>Bd,panLinear:()=>Qh,panLog:()=>Zh,panPow:()=>Xh,panSymlog:()=>Jh,parse:()=>GK,parseExpression:()=>aW,parseSelector:()=>mj,pathCurves:()=>zE,pathEqual:()=>cA,pathParse:()=>VE,pathRectangle:()=>dN,pathRender:()=>JE,pathSymbols:()=>iN,pathTrail:()=>gN,peek:()=>Vh,point:()=>VD,projection:()=>ZR,quantileLogNormal:()=>db,quantileNormal:()=>sb,quantileUniform:()=>vb,quantiles:()=>jv,quantizeInterpolator:()=>sE,quarter:()=>rd,quartiles:()=>$v,random:()=>Gv,randomInteger:()=>Jv,randomKDE:()=>lb,randomLCG:()=>Xv,randomLogNormal:()=>gb,randomMixture:()=>pb,randomNormal:()=>ab,randomUniform:()=>bb,read:()=>q_,regressionExp:()=>Eb,regressionLinear:()=>xb,regressionLoess:()=>Ab,regressionLog:()=>kb,regressionPoly:()=>Db,regressionPow:()=>Nb,regressionQuad:()=>Lb,renderModule:()=>tA,repeat:()=>Fd,resetDefaultLocale:()=>C_,resetSVGClipId:()=>LN,resetSVGDefIds:()=>uA,responseType:()=>$_,runtimeContext:()=>bU,sampleCurve:()=>Rb,sampleLogNormal:()=>cb,sampleNormal:()=>ib,sampleUniform:()=>fb,scale:()=>Gk,sceneEqual:()=>lA,sceneFromJSON:()=>OD,scenePickVisit:()=>wL,sceneToJSON:()=>ID,sceneVisit:()=>CL,sceneZOrder:()=>yL,scheme:()=>dE,serializeXML:()=>IT,setRandom:()=>Yv,span:()=>zd,splitAccessPath:()=>Ch,stringValue:()=>Hd,textMetrics:()=>aD,timeBin:()=>Of,timeFloor:()=>uf,timeFormatLocale:()=>__,timeInterval:()=>mf,timeOffset:()=>bf,timeSequence:()=>wf,timeUnitSpecifier:()=>jp,timeUnits:()=>Vp,toBoolean:()=>Wd,toDate:()=>Ud,toNumber:()=>Uh,toSet:()=>$d,toString:()=>jd,transform:()=>Mv,transforms:()=>Iv,truncate:()=>qd,truthy:()=>Nh,tupleid:()=>J_,typeParsers:()=>O_,utcFloor:()=>gf,utcInterval:()=>_f,utcOffset:()=>yf,utcSequence:()=>Sf,utcdayofyear:()=>Jp,utcquarter:()=>sd,utcweek:()=>ef,version:()=>YK,visitArray:()=>Kd,week:()=>Gp,writeConfig:()=>Hh,zero:()=>kh,zoomLinear:()=>td,zoomLog:()=>nd,zoomPow:()=>id,zoomSymlog:()=>od});var v={};n.r(v),n.d(v,{JsonPatchError:()=>lG,_areEquals:()=>vG,applyOperation:()=>gG,applyPatch:()=>pG,applyReducer:()=>fG,deepClone:()=>cG,getValueByPointer:()=>dG,validate:()=>_G,validator:()=>mG});var b={};n.r(b),n.d(b,{compare:()=>EG,generate:()=>xG,observe:()=>SG,unobserve:()=>wG});var y={};n.r(y),n.d(y,{accessPathDepth:()=>XY,accessPathWithDatum:()=>qY,compile:()=>Qee,contains:()=>EY,deepEqual:()=>bY,deleteNestedProperty:()=>jY,duplicate:()=>yY,entries:()=>HY,every:()=>LY,fieldIntersection:()=>PY,flatAccessWithDatum:()=>KY,getFirstDefined:()=>JY,hasIntersection:()=>MY,hash:()=>xY,internalField:()=>iQ,isBoolean:()=>WY,isEmpty:()=>FY,isEqual:()=>IY,isInternalField:()=>oQ,isNullOrFalse:()=>kY,isNumeric:()=>sQ,keys:()=>BY,logicalExpr:()=>UY,mergeDeep:()=>DY,normalize:()=>D2,normalizeAngle:()=>rQ,omit:()=>wY,pick:()=>CY,prefixGenerator:()=>RY,removePathFromField:()=>ZY,replaceAll:()=>QY,replacePathInField:()=>YY,resetIdCounter:()=>nQ,setEqual:()=>OY,some:()=>NY,stringify:()=>SY,titleCase:()=>$Y,unique:()=>AY,uniqueId:()=>tQ,vals:()=>zY,varName:()=>VY,version:()=>Zee});var C={};n.r(C),n.d(C,{dark:()=>ete,excel:()=>nte,fivethirtyeight:()=>ate,ggplot2:()=>cte,googlecharts:()=>Tte,latimes:()=>fte,quartz:()=>vte,urbaninstitute:()=>Ete,version:()=>Ate,vox:()=>yte}),n(6458);var w,S=e=>"function"==typeof e?e:function(){return e},x="undefined"!=typeof self?self:null,k="undefined"!=typeof window?window:null,E=x||k||void 0,N="closed",L="errored",D="joined",T="joining",A="leaving",I="phx_close",O="phx_error",M="phx_reply",R="phx_leave",P=class{constructor(e,t,n,i){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},F=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},B=class{static request(e,t,n,i,o,r,s){if(E.XDomainRequest){let n=new E.XDomainRequest;this.xdomainRequest(n,e,t,i,o,r,s)}else{let a=new E.XMLHttpRequest;this.xhrRequest(a,e,t,n,i,o,r,s)}}static xdomainRequest(e,t,n,i,o,r,s){e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);s&&s(t)},r&&(e.ontimeout=r),e.onprogress=()=>{},e.send(i)}static xhrRequest(e,t,n,i,o,r,s,a){e.open(t,n,!0),e.timeout=r,e.setRequestHeader("Content-Type",i),e.onerror=()=>{a&&a(null)},e.onreadystatechange=()=>{if(4===e.readyState&&a){let t=this.parseJSON(e.responseText);a(t)}},s&&(e.ontimeout=s),e.send(o)}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let o=t?`${t}[${i}]`:i,r=e[i];"object"==typeof r?n.push(this.serialize(r,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(r))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},z=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,this.poll()}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/websocket"),"$1/longpoll")}endpointURL(){return B.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(){this.close(),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry()}poll(){1!==this.readyState&&0!==this.readyState||B.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(e=>{if(e){var{status:t,token:n,messages:i}=e;this.token=n}else t=0;switch(t){case 200:i.forEach((e=>{setTimeout((()=>{this.onmessage({data:e})}),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen(),this.poll();break;case 403:this.onerror(),this.close();break;case 0:case 500:this.onerror(),this.closeAndRetry();break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){B.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(e=>{e&&200===e.status||(this.onerror(e&&e.status),this.closeAndRetry())}))}close(e,t){this.readyState=3,this.onclose()}},H={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,i,o,r,s]=JSON.parse(e);return t({join_ref:n,ref:i,topic:o,event:r,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:i,topic:o,payload:r}=e,s=this.META_LENGTH+t.length+n.length+o.length+i.length,a=new ArrayBuffer(this.HEADER_LENGTH+s),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,n.length),l.setUint8(c++,o.length),l.setUint8(c++,i.length),Array.from(t,(e=>l.setUint8(c++,e.charCodeAt(0)))),Array.from(n,(e=>l.setUint8(c++,e.charCodeAt(0)))),Array.from(o,(e=>l.setUint8(c++,e.charCodeAt(0)))),Array.from(i,(e=>l.setUint8(c++,e.charCodeAt(0))));var u=new Uint8Array(a.byteLength+r.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(r),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,i);case this.KINDS.reply:return this.decodeReply(e,t,i);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,i)}},decodePush(e,t,n){let i=t.getUint8(1),o=t.getUint8(2),r=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,a=n.decode(e.slice(s,s+i));s+=i;let l=n.decode(e.slice(s,s+o));s+=o;let c=n.decode(e.slice(s,s+r));return s+=r,{join_ref:a,ref:null,topic:l,event:c,payload:e.slice(s,e.byteLength)}},decodeReply(e,t,n){let i=t.getUint8(1),o=t.getUint8(2),r=t.getUint8(3),s=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=n.decode(e.slice(a,a+i));a+=i;let c=n.decode(e.slice(a,a+o));a+=o;let u=n.decode(e.slice(a,a+r));a+=r;let h=n.decode(e.slice(a,a+s));a+=s;let d=e.slice(a,e.byteLength);return{join_ref:l,ref:c,topic:u,event:M,payload:{status:h,response:d}}},decodeBroadcast(e,t,n){let i=t.getUint8(1),o=t.getUint8(2),r=this.HEADER_LENGTH+2,s=n.decode(e.slice(r,r+i));r+=i;let a=n.decode(e.slice(r,r+o));return r+=o,{join_ref:null,ref:null,topic:s,event:a,payload:e.slice(r,e.byteLength)}}},W=n(4173),V=n.n(W),U="consecutive-reloads",j=[1e3,3e3],$=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],q="data-phx-component",K="data-phx-link",G="data-phx-ref",Y="track-uploads",Q="data-phx-upload-ref",Z="data-phx-preflighted-refs",X="drop-target",J="data-phx-active-refs",ee="phx:live-file:updated",te="data-phx-skip",ne="data-phx-remove",ie="page-loading",oe="phx-connected",re="phx-disconnected",se="phx-no-feedback",ae="phx-error",le="data-phx-parent-id",ce="data-phx-main",ue="data-phx-root-id",he="feedback-for",de="phx-has-focused",ge=["text","textarea","number","email","password","search","tel","url","date","time"],pe=["checkbox","radio"],fe="phx-has-submitted",me="data-phx-session",_e=`[${me}]`,ve="data-phx-static",be="data-phx-readonly",ye="data-phx-disabled",Ce="disable-with",we="data-phx-disable-with-restore",Se="hook",xe="update",ke="auto-recover",Ee="phx:live-socket:debug",Ne="phx:live-socket:profiling",Le="phx:live-socket:latency-sim",De="debounce-trigger",Te="throttled",Ae="debounce-prev-key",Ie={debounce:300,throttle:300},Oe="d",Me="s",Re="e",Pe="r",Fe="t",Be=(e,t)=>console.error&&console.error(e,t),ze=e=>"number"==typeof e,He=e=>"function"==typeof e?e:function(){return e},We=e=>JSON.parse(JSON.stringify(e)),Ve=(e,t,n)=>{do{if(e.matches(`[${t}]`))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType&&!(n&&n.isSameNode(e)||e.matches(_e)));return null},Ue=e=>null!==e&&"object"==typeof e&&!(e instanceof Array),je=e=>{for(let t in e)return!1;return!0},$e=(e,t)=>e&&t(e),qe=function(e,t,n,i){e.forEach((e=>{let t=new class{constructor(e,t,n){this.liveSocket=n,this.entry=e,this.offset=0,this.chunkSize=t,this.chunkTimer=null,this.uploadChannel=n.channel(`lvu:${e.ref}`,{token:e.metadata()})}error(e){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(e)}upload(){this.uploadChannel.onError((e=>this.error(e))),this.uploadChannel.join().receive("ok",(e=>this.readNextChunk())).receive("error",(e=>this.error(e)))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let e=new window.FileReader,t=this.entry.file.slice(this.offset,this.chunkSize+this.offset);e.onload=e=>{if(null!==e.target.error)return Be("Read error: "+e.target.error);this.offset+=e.target.result.byteLength,this.pushChunk(e.target.result)},e.readAsArrayBuffer(t)}pushChunk(e){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",e).receive("ok",(()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout((()=>this.readNextChunk()),this.liveSocket.getLatencySim()||0))}))}}(e,n.config.chunk_size,i);t.upload()}))},Ke={canPushState:()=>void 0!==history.pushState,dropLocal(e,t,n){return e.removeItem(this.localKey(t,n))},updateLocal(e,t,n,i,o){let r=this.getLocal(e,t,n),s=this.localKey(t,n),a=null===r?i:o(r);return e.setItem(s,JSON.stringify(a)),a},getLocal(e,t,n){return JSON.parse(e.getItem(this.localKey(t,n)))},updateCurrentState(e){this.canPushState()&&history.replaceState(e(history.state||{}),"",window.location.href)},pushState(e,t,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==t.type&&t.scroll){let e=history.state||{};e.scroll=t.scroll,history.replaceState(e,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",n||null);let i=this.getHashTargetEl(window.location.hash);i?i.scrollIntoView():"redirect"===t.type&&window.scroll(0,0)}}else this.redirect(n)},setCookie(e,t){document.cookie=`${e}=${t}`},getCookie:e=>document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${e}s*=s*([^;]*).*$)|^.*$`),"$1"),redirect(e,t){t&&Ke.setCookie("__phoenix_flash__",t+"; max-age=60000; path=/"),window.location=e},localKey:(e,t)=>`${e}-${t}`,getHashTargetEl(e){let t=e.toString().substring(1);if(""!==t)return document.getElementById(t)||document.querySelector(`a[name="${t}"]`)}},Ge=Ke,Ye={byId:e=>document.getElementById(e)||Be(`no id found for ${e}`),removeClass(e,t){e.classList.remove(t),0===e.classList.length&&e.removeAttribute("class")},all(e,t,n){if(!e)return[];let i=Array.from(e.querySelectorAll(t));return n?i.forEach(n):i},childNodeLength(e){let t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput:e=>"file"===e.type&&null!==e.getAttribute(Q),findUploadInputs(e){return this.all(e,`input[type="file"][${Q}]`)},findComponentNodeList(e,t){return this.filterWithinSameLiveView(this.all(e,`[${q}="${t}"]`),e)},isPhxDestroyed:e=>!(!e.id||!Ye.private(e,"destroyed")),markPhxChildDestroyed(e){e.setAttribute(me,""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment(e,t){let n=document.createElement("template");return n.innerHTML=e,this.findPhxChildren(n.content,t)},isIgnored:(e,t)=>"ignore"===(e.getAttribute(t)||e.getAttribute("data-phx-update")),isPhxUpdate:(e,t,n)=>e.getAttribute&&n.indexOf(e.getAttribute(t))>=0,findPhxChildren(e,t){return this.all(e,`${_e}[${le}="${t}"]`)},findParentCIDs(e,t){let n=new Set(t);return t.reduce(((t,n)=>{let i=`[${q}="${n}"] [${q}]`;return this.filterWithinSameLiveView(this.all(e,i),e).map((e=>parseInt(e.getAttribute(q)))).forEach((e=>t.delete(e))),t}),n)},filterWithinSameLiveView(e,t){return t.querySelector(_e)?e.filter((e=>this.withinSameLiveView(e,t))):e},withinSameLiveView(e,t){for(;e=e.parentNode;){if(e.isSameNode(t))return!0;if(null!==e.getAttribute(me))return!1}},private:(e,t)=>e.phxPrivate&&e.phxPrivate[t],deletePrivate(e,t){e.phxPrivate&&delete e.phxPrivate[t]},putPrivate(e,t,n){e.phxPrivate||(e.phxPrivate={}),e.phxPrivate[t]=n},copyPrivates(e,t){t.phxPrivate&&(e.phxPrivate=We(t.phxPrivate))},putTitle(e){let t=document.querySelector("title"),{prefix:n,suffix:i}=t.dataset;document.title=`${n||""}${e}${i||""}`},debounce(e,t,n,i,o,r,s){let a=e.getAttribute(n),l=e.getAttribute(o);""===a&&(a=i),""===l&&(l=r);let c=a||l;switch(c){case null:return s();case"blur":return void(this.once(e,"debounce-blur")&&e.addEventListener("blur",(()=>s())));default:let n=parseInt(c),i=()=>l?this.deletePrivate(e,Te):s(),o=this.incCycle(e,De,i);if(isNaN(n))return Be(`invalid throttle/debounce value: ${c}`);if(l){let i=!1;if("keydown"===t.type){let n=this.private(e,Ae);this.putPrivate(e,Ae,t.key),i=n!==t.key}if(!i&&this.private(e,Te))return!1;s(),this.putPrivate(e,Te,!0),setTimeout((()=>this.triggerCycle(e,De)),n)}else setTimeout((()=>this.triggerCycle(e,De,o)),n);let r=e.form;r&&this.once(r,"bind-debounce")&&r.addEventListener("submit",(()=>{Array.from(new FormData(r).entries(),(([e])=>{let t=r.querySelector(`[name="${e}"]`);this.incCycle(t,De),this.deletePrivate(t,Te)}))})),this.once(e,"bind-debounce")&&e.addEventListener("blur",(()=>this.triggerCycle(e,De)))}},triggerCycle(e,t,n){let[i,o]=this.private(e,t);n||(n=i),n===i&&(this.incCycle(e,t),o())},once(e,t){return!0!==this.private(e,t)&&(this.putPrivate(e,t,!0),!0)},incCycle(e,t,n=function(){}){let[i]=this.private(e,t)||[0,n];return i++,this.putPrivate(e,t,[i,n]),i},discardError(e,t,n){let i=t.getAttribute&&t.getAttribute(n),o=i&&e.querySelector(`[id="${i}"], [name="${i}"]`);o&&(this.private(o,de)||this.private(o.form,fe)||t.classList.add(se))},showError(e,t){(e.id||e.name)&&this.all(e.form,`[${t}="${e.id}"], [${t}="${e.name}"]`,(e=>{this.removeClass(e,se)}))},isPhxChild:e=>e.getAttribute&&e.getAttribute(le),dispatchEvent(e,t,n={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(i)},cloneNode(e,t){if(void 0===t)return e.cloneNode(!0);{let n=e.cloneNode(!1);return n.innerHTML=t,n}},mergeAttrs(e,t,n={}){let i=n.exclude||[],o=n.isIgnored,r=t.attributes;for(let n=r.length-1;n>=0;n--){let o=r[n].name;i.indexOf(o)<0&&e.setAttribute(o,t.getAttribute(o))}let s=e.attributes;for(let n=s.length-1;n>=0;n--){let i=s[n].name;o?i.startsWith("data-")&&!t.hasAttribute(i)&&e.removeAttribute(i):t.hasAttribute(i)||e.removeAttribute(i)}},mergeFocusedInput(e,t){e instanceof HTMLSelectElement||Ye.mergeAttrs(e,t,{except:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange:e=>e.setSelectionRange&&("text"===e.type||"textarea"===e.type),restoreFocus(e,t,n){if(!Ye.isTextualInput(e))return;let i=e.matches(":focus");e.readOnly&&e.blur(),i||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,n)},isFormInput:e=>/^(?:input|select|textarea)$/i.test(e.tagName)&&"button"!==e.type,syncAttrsToProps(e){e instanceof HTMLInputElement&&pe.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=null!==e.getAttribute("checked"))},syncPropsToAttrs(e){if(e instanceof HTMLSelectElement){let t=e.options.item(e.selectedIndex);t&&null===t.getAttribute("selected")&&t.setAttribute("selected","")}},isTextualInput:e=>ge.indexOf(e.type)>=0,isNowTriggerFormExternal:(e,t)=>e.getAttribute&&null!==e.getAttribute(t),syncPendingRef(e,t,n){let i=e.getAttribute(G);return null===i||(Ye.isFormInput(e)||null!==e.getAttribute(n)?(Ye.isUploadInput(e)&&Ye.mergeAttrs(e,t,{isIgnored:!0}),Ye.putPrivate(e,G,t),!1):($.forEach((n=>{e.classList.contains(n)&&t.classList.add(n)})),t.setAttribute(G,i),!0))},cleanChildNodes(e,t){if(Ye.isPhxUpdate(e,t,["append","prepend"])){let t=[];e.childNodes.forEach((e=>{e.id||(e.nodeType===Node.TEXT_NODE&&""===e.nodeValue.trim()||Be(`only HTML element tags with an id are allowed inside containers with phx-update.\n\nremoving illegal node: "${(e.outerHTML||e.nodeValue).trim()}"\n\n`),t.push(e))})),t.forEach((e=>e.remove()))}},replaceRootContainer(e,t,n){let i=new Set(["id",me,ve,ce]);if(e.tagName.toLowerCase()===t.toLowerCase())return Array.from(e.attributes).filter((e=>!i.has(e.name.toLowerCase()))).forEach((t=>e.removeAttribute(t.name))),Object.keys(n).filter((e=>!i.has(e.toLowerCase()))).forEach((t=>e.setAttribute(t,n[t]))),e;{let o=document.createElement(t);return Object.keys(n).forEach((e=>o.setAttribute(e,n[e]))),i.forEach((t=>o.setAttribute(t,e.getAttribute(t)))),o.innerHTML=e.innerHTML,e.replaceWith(o),o}}},Qe=Ye,Ze=class{static isActive(e,t){let n=void 0===t._phxRef,i=e.getAttribute(J).split(",").indexOf(Je.genFileRef(t))>=0;return t.size>0&&(n||i)}static isPreflighted(e,t){return e.getAttribute(Z).split(",").indexOf(Je.genFileRef(t))>=0&&this.isActive(e,t)}constructor(e,t,n){this.ref=Je.genFileRef(t),this.fileEl=e,this.file=t,this.view=n,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(ee,this._onElUpdated)}metadata(){return this.meta}progress(e){this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,(()=>{Je.untrackFile(this.fileEl,this.file),this._onDone()}))):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}cancel(){this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(e="failed"){this.view.pushFileProgress(this.fileEl,this.ref,{error:e}),Je.clearFiles(this.fileEl)}onDone(e){this._onDone=()=>{this.fileEl.removeEventListener(ee,this._onElUpdated),e()}}onElUpdated(){-1===this.fileEl.getAttribute(J).split(",").indexOf(this.ref)&&this.cancel()}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,size:this.file.size,type:this.file.type,ref:this.ref}}uploader(e){if(this.meta.uploader){let t=e[this.meta.uploader]||Be(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:t}}return{name:"channel",callback:qe}}zipPostFlight(e){this.meta=e.entries[this.ref],this.meta||Be(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:e})}},Xe=0,Je=class{static genFileRef(e){let t=e._phxRef;return void 0!==t?t:(e._phxRef=(Xe++).toString(),e._phxRef)}static getEntryDataURL(e,t,n){let i=this.activeFiles(e).find((e=>this.genFileRef(e)===t));n(URL.createObjectURL(i))}static hasUploadsInProgress(e){let t=0;return Qe.findUploadInputs(e).forEach((e=>{e.getAttribute(Z)!==e.getAttribute("data-phx-done-refs")&&t++})),t>0}static serializeUploads(e){let t=this.activeFiles(e),n={};return t.forEach((t=>{let i={path:e.name},o=e.getAttribute(Q);n[o]=n[o]||[],i.ref=this.genFileRef(t),i.name=t.name||i.ref,i.type=t.type,i.size=t.size,n[o].push(i)})),n}static clearFiles(e){e.value=null,e.removeAttribute(Q),Qe.putPrivate(e,"files",[])}static untrackFile(e,t){Qe.putPrivate(e,"files",Qe.private(e,"files").filter((e=>!Object.is(e,t))))}static trackFiles(e,t){if(null!==e.getAttribute("multiple")){let n=t.filter((t=>!this.activeFiles(e).find((e=>Object.is(e,t)))));Qe.putPrivate(e,"files",this.activeFiles(e).concat(n)),e.value=null}else Qe.putPrivate(e,"files",t)}static activeFileInputs(e){let t=Qe.findUploadInputs(e);return Array.from(t).filter((e=>e.files&&this.activeFiles(e).length>0))}static activeFiles(e){return(Qe.private(e,"files")||[]).filter((t=>Ze.isActive(e,t)))}static inputsAwaitingPreflight(e){let t=Qe.findUploadInputs(e);return Array.from(t).filter((e=>this.filesAwaitingPreflight(e).length>0))}static filesAwaitingPreflight(e){return this.activeFiles(e).filter((t=>!Ze.isPreflighted(e,t)))}constructor(e,t,n){this.view=t,this.onComplete=n,this._entries=Array.from(Je.filesAwaitingPreflight(e)||[]).map((n=>new Ze(e,n,t))),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(e,t,n){this._entries=this._entries.map((t=>(t.zipPostFlight(e),t.onDone((()=>{this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()})),t)));let i=this._entries.reduce(((e,t)=>{let{name:i,callback:o}=t.uploader(n.uploaders);return e[i]=e[i]||{callback:o,entries:[]},e[i].entries.push(t),e}),{});for(let o in i){let{callback:r,entries:s}=i[o];r(s,t,e,n)}}},et={LiveFileUpload:{activeRefs(){return this.el.getAttribute(J)},preflightedRefs(){return this.el.getAttribute(Z)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let e=this.preflightedRefs();this.preflightedWas!==e&&(this.preflightedWas=e,""===e&&this.__view.cancelSubmit(this.el.form)),""===this.activeRefs()&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(ee))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(Q)),Je.getEntryDataURL(this.inputEl,this.ref,(e=>{this.url=e,this.el.src=e}))},destroyed(){URL.revokeObjectURL(this.url)}}},tt="undefined"==typeof document?void 0:document,nt=!!tt&&"content"in tt.createElement("template"),it=!!tt&&tt.createRange&&"createContextualFragment"in tt.createRange();function ot(e,t){var n,i,o=e.nodeName,r=t.nodeName;return o===r||(n=o.charCodeAt(0),i=r.charCodeAt(0),n<=90&&i>=97?o===r.toUpperCase():i<=90&&n>=97&&r===o.toUpperCase())}function rt(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var st={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}rt(e,t,"selected")},INPUT:function(e,t){rt(e,t,"checked"),rt(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var o=i.nodeValue;if(o==n||!n&&o==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,o=-1,r=0,s=e.firstChild;s;)if("OPTGROUP"===(i=s.nodeName&&s.nodeName.toUpperCase()))s=(n=s).firstChild;else{if("OPTION"===i){if(s.hasAttribute("selected")){o=r;break}r++}!(s=s.nextSibling)&&n&&(s=n.nextSibling,n=null)}e.selectedIndex=o}}};function at(){}function lt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var ct,ut=(ct=function(e,t){var n,i,o,r,s=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var a=s.length-1;a>=0;a--)i=(n=s[a]).name,o=n.namespaceURI,r=n.value,o?(i=n.localName||i,e.getAttributeNS(o,i)!==r&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(o,i,r))):e.getAttribute(i)!==r&&e.setAttribute(i,r);for(var l=e.attributes,c=l.length-1;c>=0;c--)i=(n=l[c]).name,(o=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}},function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var i=t;(t=tt.createElement("html")).innerHTML=i}else o=(o=t).trim(),t=nt?function(e){var t=tt.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(o):it?function(e){return w||(w=tt.createRange()).selectNode(tt.body),w.createContextualFragment(e).childNodes[0]}(o):function(e){var t=tt.createElement("body");return t.innerHTML=e,t.childNodes[0]}(o);var o,r=n.getNodeKey||lt,s=n.onBeforeNodeAdded||at,a=n.onNodeAdded||at,l=n.onBeforeElUpdated||at,c=n.onElUpdated||at,u=n.onBeforeNodeDiscarded||at,h=n.onNodeDiscarded||at,d=n.onBeforeElChildrenUpdated||at,g=!0===n.childrenOnly,p=Object.create(null),f=[];function m(e){f.push(e)}function _(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var i=void 0;t&&(i=r(n))?m(i):(h(n),n.firstChild&&_(n,t)),n=n.nextSibling}}function v(e,t,n){!1!==u(e)&&(t&&t.removeChild(e),h(e),_(e,n))}function b(e){a(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=r(t);if(i){var o=p[i];o&&ot(t,o)?(t.parentNode.replaceChild(o,t),y(o,t)):b(t)}else b(t);t=n}}function y(e,t,n){var i=r(t);if(i&&delete p[i],!n){if(!1===l(e,t))return;if(ct(e,t),c(e),!1===d(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,i,o,a,l,c=t.firstChild,u=e.firstChild;e:for(;c;){for(a=c.nextSibling,n=r(c);u;){if(o=u.nextSibling,c.isSameNode&&c.isSameNode(u)){c=a,u=o;continue e}i=r(u);var h=u.nodeType,d=void 0;if(h===c.nodeType&&(1===h?(n?n!==i&&((l=p[n])?o===l?d=!1:(e.insertBefore(l,u),i?m(i):v(u,e,!0),u=l):d=!1):i&&(d=!1),(d=!1!==d&&ot(u,c))&&y(u,c)):3!==h&&8!=h||(d=!0,u.nodeValue!==c.nodeValue&&(u.nodeValue=c.nodeValue))),d){c=a,u=o;continue e}i?m(i):v(u,e,!0),u=o}if(n&&(l=p[n])&&ot(l,c))e.appendChild(l),y(l,c);else{var g=s(c);!1!==g&&(g&&(c=g),c.actualize&&(c=c.actualize(e.ownerDocument||tt)),e.appendChild(c),b(c))}c=a,u=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=r(t))?m(n):v(t,e,!0),t=i}}(e,u,i);var f=st[e.nodeName];f&&f(e,t)}(e,t):st.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=r(n);i&&(p[i]=n),e(n),n=n.nextSibling}}(e);var C,S,x=e,k=x.nodeType,E=t.nodeType;if(!g)if(1===k)1===E?ot(e,t)||(h(e),x=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(e,(C=t.nodeName,(S=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==S?tt.createElementNS(S,C):tt.createElement(C)))):x=t;else if(3===k||8===k){if(E===k)return x.nodeValue!==t.nodeValue&&(x.nodeValue=t.nodeValue),x;x=t}if(x===t)h(e);else{if(t.isSameNode&&t.isSameNode(x))return;if(y(x,t,g),f)for(var N=0,L=f.length;N{if(n&&n.isSameNode(e)&&Qe.isFormInput(e))return Qe.mergeFocusedInput(e,t),!1}})}constructor(e,t,n,i,o){this.view=e,this.liveSocket=e.liveSocket,this.container=t,this.id=n,this.rootID=e.root.id,this.html=i,this.targetCID=o,this.cidPatch=ze(this.targetCID),this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[]}}before(e,t){this.callbacks[`before${e}`].push(t)}after(e,t){this.callbacks[`after${e}`].push(t)}trackBefore(e,...t){this.callbacks[`before${e}`].forEach((e=>e(...t)))}trackAfter(e,...t){this.callbacks[`after${e}`].forEach((e=>e(...t)))}markPrunableContentForRemoval(){Qe.all(this.container,"[phx-update=append] > *, [phx-update=prepend] > *",(e=>{e.setAttribute(ne,"")}))}perform(){let{view:e,liveSocket:t,container:n,html:i}=this,o=this.isCIDPatch()?this.targetCIDContainer(i):n;if(this.isCIDPatch()&&!o)return;let r=t.getActiveElement(),{selectionStart:s,selectionEnd:a}=r&&Qe.hasSelectionRange(r)?r:{},l=t.binding(xe),c=t.binding(he),u=t.binding(Ce),h=t.binding("trigger-action"),d=[],g=[],p=[],f=null,m=t.time("premorph container prep",(()=>this.buildDiffHTML(n,i,l,o)));return this.trackBefore("added",n),this.trackBefore("updated",n,n),t.time("morphdom",(()=>{ht(o,m,{childrenOnly:null===o.getAttribute(q),getNodeKey:e=>Qe.isPhxDestroyed(e)?null:e.id,onBeforeNodeAdded:e=>(this.trackBefore("added",e),e),onNodeAdded:t=>{Qe.isNowTriggerFormExternal(t,h)&&(f=t),Qe.discardError(o,t,c),Qe.isPhxChild(t)&&e.ownsElement(t)&&this.trackAfter("phxChildAdded",t),d.push(t)},onNodeDiscarded:e=>{Qe.isPhxChild(e)&&t.destroyViewByEl(e),this.trackAfter("discarded",e)},onBeforeNodeDiscarded:e=>!((!e.getAttribute||null===e.getAttribute(ne))&&(null!==e.parentNode&&Qe.isPhxUpdate(e.parentNode,l,["append","prepend"])&&e.id||this.skipCIDSibling(e))),onElUpdated:e=>{Qe.isNowTriggerFormExternal(e,h)&&(f=e),g.push(e)},onBeforeElUpdated:(e,t)=>{if(Qe.cleanChildNodes(t,l),this.skipCIDSibling(t))return!1;if(Qe.isIgnored(e,l))return this.trackBefore("updated",e,t),Qe.mergeAttrs(e,t,{isIgnored:!0}),g.push(e),!1;if("number"===e.type&&e.validity&&e.validity.badInput)return!1;if(!Qe.syncPendingRef(e,t,u))return Qe.isUploadInput(e)&&(this.trackBefore("updated",e,t),g.push(e)),!1;if(Qe.isPhxChild(t)){let n=e.getAttribute(me);return Qe.mergeAttrs(e,t,{exclude:[ve]}),""!==n&&e.setAttribute(me,n),e.setAttribute(ue,this.rootID),!1}return Qe.copyPrivates(t,e),Qe.discardError(o,t,c),Qe.syncPropsToAttrs(t),r&&e.isSameNode(r)&&Qe.isFormInput(e)&&!this.forceFocusedSelectUpdate(e,t)?(this.trackBefore("updated",e,t),Qe.mergeFocusedInput(e,t),Qe.syncAttrsToProps(e),g.push(e),!1):(Qe.isPhxUpdate(t,l,["append","prepend"])&&p.push(new class{constructor(e,t,n){let i=new Set,o=new Set([...t.children].map((e=>e.id))),r=[];Array.from(e.children).forEach((e=>{if(e.id&&(i.add(e.id),o.has(e.id))){let t=e.previousElementSibling&&e.previousElementSibling.id;r.push({elementId:e.id,previousElementId:t})}})),this.containerId=t.id,this.updateType=n,this.elementsToModify=r,this.elementIdsToAdd=[...o].filter((e=>!i.has(e)))}perform(){let e=Qe.byId(this.containerId);this.elementsToModify.forEach((t=>{t.previousElementId?$e(document.getElementById(t.previousElementId),(e=>{$e(document.getElementById(t.elementId),(t=>{t.previousElementSibling&&t.previousElementSibling.id==e.id||e.insertAdjacentElement("afterend",t)}))})):$e(document.getElementById(t.elementId),(t=>{null==t.previousElementSibling||e.insertAdjacentElement("afterbegin",t)}))})),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEach((t=>{$e(document.getElementById(t),(t=>e.insertAdjacentElement("afterbegin",t)))}))}}(e,t,t.getAttribute(l))),Qe.syncAttrsToProps(t),this.trackBefore("updated",e,t),!0)}})})),t.isDebugEnabled()&&function(){let e=new Set,t=document.querySelectorAll("*[id]");for(let n=0,i=t.length;n0&&t.time("post-morph append/prepend restoration",(()=>{p.forEach((e=>e.perform()))})),t.silenceEvents((()=>Qe.restoreFocus(r,s,a))),Qe.dispatchEvent(document,"phx:update"),d.forEach((e=>this.trackAfter("added",e))),g.forEach((e=>this.trackAfter("updated",e))),f&&(t.disconnect(),f.submit()),!0}forceFocusedSelectUpdate(e,t){let n=["select","select-one","select-multiple"].find((t=>t===e.type));return!0===e.multiple||n&&e.innerHTML!=t.innerHTML}isCIDPatch(){return this.cidPatch}skipCIDSibling(e){return e.nodeType===Node.ELEMENT_NODE&&null!==e.getAttribute(te)}targetCIDContainer(e){if(!this.isCIDPatch())return;let[t,...n]=Qe.findComponentNodeList(this.container,this.targetCID);return 0===n.length&&1===Qe.childNodeLength(e)?t:t&&t.parentNode}buildDiffHTML(e,t,n,i){let o=this.isCIDPatch(),r=o&&i.getAttribute(q)===this.targetCID.toString();if(!o||r)return t;{let e=null,n=document.createElement("template");e=Qe.cloneNode(i);let[o,...r]=Qe.findComponentNodeList(e,this.targetCID);return n.innerHTML=t,r.forEach((e=>e.remove())),Array.from(e.childNodes).forEach((e=>{e.id&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(q)!==this.targetCID.toString()&&(e.setAttribute(te,""),e.innerHTML="")})),Array.from(n.content.childNodes).forEach((t=>e.insertBefore(t,o))),o.remove(),e.outerHTML}}},gt=class{static extract(e){let{[Pe]:t,[Re]:n,[Fe]:i}=e;return delete e[Pe],delete e[Re],delete e[Fe],{diff:e,title:i,reply:t||null,events:n||[]}}constructor(e,t){this.viewId=e,this.rendered={},this.mergeDiff(t)}parentViewId(){return this.viewId}toString(e){return this.recursiveToString(this.rendered,this.rendered.c,e)}recursiveToString(e,t=e.c,n){let i={buffer:"",components:t,onlyCids:n=n?new Set(n):null};return this.toOutputBuffer(e,i),i.buffer}componentCIDs(e){return Object.keys(e.c||{}).map((e=>parseInt(e)))}isComponentOnlyDiff(e){return!!e.c&&1===Object.keys(e).length}getComponent(e,t){return e.c[t]}mergeDiff(e){let t=e.c,n={};if(delete e.c,this.rendered=this.mutableMerge(this.rendered,e),this.rendered.c=this.rendered.c||{},t){let o=this.rendered.c;for(let e in t)t[e]=this.cachedFindComponent(e,t[e],o,t,n);for(var i in t)o[i]=t[i];e.c=t}}cachedFindComponent(e,t,n,i,o){if(o[e])return o[e];{let r,s,a=t[Me];if(ze(a)){let e;e=a>0?this.cachedFindComponent(a,i[a],n,i,o):n[-a],s=e[Me],r=this.cloneMerge(e,t),r[Me]=s}else r=void 0!==t[Me]?t:this.cloneMerge(n[e]||{},t);return o[e]=r,r}}mutableMerge(e,t){return void 0!==t[Me]?t:(this.doMutableMerge(e,t),e)}doMutableMerge(e,t){for(let n in t){let i=t[n],o=e[n];Ue(i)&&void 0===i[Me]&&Ue(o)?this.doMutableMerge(o,i):e[n]=i}}cloneMerge(e,t){let n={...e,...t};for(let i in n){let o=t[i],r=e[i];Ue(o)&&void 0===o[Me]&&Ue(r)&&(n[i]=this.cloneMerge(r,o))}return n}componentToString(e){return this.recursiveCIDToString(this.rendered.c,e)}pruneCIDs(e){e.forEach((e=>delete this.rendered.c[e]))}get(){return this.rendered}isNewFingerprint(e={}){return!!e[Me]}toOutputBuffer(e,t){if(e[Oe])return this.comprehensionToBuffer(e,t);let{[Me]:n}=e;t.buffer+=n[0];for(let i=1;ii.nodeType===Node.ELEMENT_NODE?i.getAttribute(q)?[e,!0]:(i.setAttribute(q,t),i.id||(i.id=`${this.parentViewId()}-${t}-${r}`),s&&(i.setAttribute(te,""),i.innerHTML=""),[!0,n]):""!==i.nodeValue.trim()?(Be(`only HTML element tags are allowed at the root of components.\n\ngot: "${i.nodeValue.trim()}"\n\nwithin:\n`,o.innerHTML.trim()),i.replaceWith(this.createSpan(i.nodeValue,t)),[!0,n]):(i.remove(),[e,n])),[!1,!1]);return a||l?!a&&l?(Be("expected at least one HTML element tag directly inside a component, but only subcomponents were found. A component must render at least one HTML tag directly inside itself.",o.innerHTML.trim()),o.innerHTML):o.innerHTML:(Be("expected at least one HTML element tag inside a component, but the component is empty:\n",o.innerHTML.trim()),this.createSpan("",t).outerHTML)}createSpan(e,t){let n=document.createElement("span");return n.innerText=e,n.setAttribute(q,t),n}},pt=1,ft=class{static makeID(){return pt++}static elementID(e){return e.phxHookId}constructor(e,t,n){this.__view=e,this.__liveSocket=e.liveSocket,this.__callbacks=n,this.__listeners=new Set,this.__isDisconnected=!1,this.el=t,this.el.phxHookId=this.constructor.makeID();for(let e in this.__callbacks)this[e]=this.__callbacks[e]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(e,t={},n=function(){}){return this.__view.pushHookEvent(null,e,t,n)}pushEventTo(e,t,n={},i=function(){}){return this.__view.withinTargets(e,((e,o)=>e.pushHookEvent(o,t,n,i)))}handleEvent(e,t){let n=(n,i)=>i?e:t(n.detail);return window.addEventListener(`phx:hook:${e}`,n),this.__listeners.add(n),n}removeHandleEvent(e){let t=e(null,!0);window.removeEventListener(`phx:hook:${t}`,e),this.__listeners.delete(e)}upload(e,t){return this.__view.dispatchUploads(e,t)}uploadTo(e,t,n){return this.__view.withinTargets(e,(e=>e.dispatchUploads(t,n)))}__cleanup__(){this.__listeners.forEach((e=>this.removeHandleEvent(e)))}},mt=(e,t={})=>{let n=new FormData(e),i=[];n.forEach(((e,t,n)=>{e instanceof File&&i.push(t)})),i.forEach((e=>n.delete(e)));let o=new URLSearchParams;for(let[e,t]of n.entries())o.append(e,t);for(let e in t)o.append(e,t[e]);return o.toString()},_t=class{constructor(e,t,n,i){this.liveSocket=t,this.flash=i,this.parent=n,this.root=n?n.root:this,this.el=e,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pruningCIDs=[],this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(){},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.uploaders={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.channel=this.liveSocket.channel(`lv:${this.id}`,(()=>({redirect:this.redirect?this.href:void 0,url:this.redirect?void 0:this.href||void 0,params:this.connectParams(),session:this.getSession(),static:this.getStatic(),flash:this.flash}))),this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel()}setHref(e){this.href=e}setRedirect(e){this.redirect=!0,this.href=e}isMain(){return this.liveSocket.main===this}connectParams(){let e=this.liveSocket.params(this.el),t=Qe.all(document,`[${this.binding("track-static")}]`).map((e=>e.src||e.href)).filter((e=>"string"==typeof e));return t.length>0&&(e._track_static=t),e._mounts=this.joinCount,e}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(me)}getStatic(){let e=this.el.getAttribute(ve);return""===e?null:e}destroy(e=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let t=()=>{e();for(let e in this.viewHooks)this.destroyHook(this.viewHooks[e])};Qe.markPhxChildDestroyed(this.el),this.log("destroyed",(()=>["the child has been removed from the parent"])),this.channel.leave().receive("ok",t).receive("error",t).receive("timeout",t)}setContainerClasses(...e){this.el.classList.remove(oe,re,ae),this.el.classList.add(...e)}isLoading(){return this.el.classList.contains(re)}showLoader(e){if(clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout((()=>this.showLoader()),e);else{for(let e in this.viewHooks)this.viewHooks[e].__disconnected();this.setContainerClasses(re)}}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses(oe)}triggerReconnected(){for(let e in this.viewHooks)this.viewHooks[e].__reconnected()}log(e,t){this.liveSocket.log(this,e,t)}withinTargets(e,t){if(e instanceof HTMLElement)return this.liveSocket.owner(e,(n=>t(n,e)));if(/^(0|[1-9]\d*)$/.test(e)){let n=Qe.findComponentNodeList(this.el,e);0===n.length?Be(`no component found matching phx-target of ${e}`):t(this,n[0])}else{let n=Array.from(document.querySelectorAll(e));0===n.length&&Be(`nothing found matching the phx-target selector "${e}"`),n.forEach((e=>this.liveSocket.owner(e,(n=>t(n,e)))))}}applyDiff(e,t,n){this.log(e,(()=>["",We(t)]));let{diff:i,reply:o,events:r,title:s}=gt.extract(t);return s&&Qe.putTitle(s),n({diff:i,reply:o,events:r}),o}onJoin(e){let{rendered:t,container:n}=e;if(n){let[e,t]=n;this.el=Qe.replaceRootContainer(this.el,e,t)}this.childJoins=0,this.joinPending=!0,this.flash=null,Ge.dropLocal(this.liveSocket.localStorage,window.location.pathname,U),this.applyDiff("mount",t,(({diff:t,events:n})=>{this.rendered=new gt(this.id,t);let i=this.renderContainer(null,"join");this.dropPendingRefs();let o=this.formsForRecovery(i);this.joinCount++,o.length>0?o.forEach((([e,t,r],s)=>{this.pushFormRecovery(e,r,(e=>{s===o.length-1&&this.onJoinComplete(e,i,n)}))})):this.onJoinComplete(e,i,n)}))}dropPendingRefs(){Qe.all(this.el,`[${G}]`,(e=>e.removeAttribute(G)))}onJoinComplete({live_patch:e},t,n){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(e,t,n);0===Qe.findPhxChildrenInFragment(t,this.id).filter((e=>{let t=e.id&&this.el.querySelector(`[id="${e.id}"]`),n=t&&t.getAttribute(ve);return n&&e.setAttribute(ve,n),this.joinChild(e)})).length?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,n)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(e,t,n)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,n)])}attachTrueDocEl(){this.el=Qe.byId(this.id),this.el.setAttribute(ue,this.root.id)}dispatchEvents(e){e.forEach((([e,t])=>{window.dispatchEvent(new CustomEvent(`phx:hook:${e}`,{detail:t}))}))}applyJoinPatch(e,t,n){this.attachTrueDocEl();let i=new dt(this,this.el,this.id,t,null);if(i.markPrunableContentForRemoval(),this.performPatch(i,!1),this.joinNewChildren(),Qe.all(this.el,`[${this.binding(Se)}], [data-phx-hook]`,(e=>{let t=this.addHook(e);t&&t.__mounted()})),this.joinPending=!1,this.dispatchEvents(n),this.applyPendingUpdates(),e){let{kind:t,to:n}=e;this.liveSocket.historyPatch(n,t)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(e,t){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,t]);let n=this.getHook(e),i=n&&Qe.isIgnored(e,this.binding(xe));if(n&&!e.isEqualNode(t)&&(!i||(o=e.dataset,r=t.dataset,JSON.stringify(o)!==JSON.stringify(r))))return n.__beforeUpdate(),n;var o,r}performPatch(e,t){let n=[],i=!1,o=new Set;return e.after("added",(e=>{this.liveSocket.triggerDOM("onNodeAdded",[e]);let t=this.addHook(e);t&&t.__mounted()})),e.after("phxChildAdded",(e=>i=!0)),e.before("updated",((e,t)=>{this.triggerBeforeUpdateHook(e,t)&&o.add(e.id)})),e.after("updated",(e=>{o.has(e.id)&&this.getHook(e).__updated()})),e.after("discarded",(e=>{let t=this.componentID(e);ze(t)&&-1===n.indexOf(t)&&n.push(t);let i=this.getHook(e);i&&this.destroyHook(i)})),e.perform(),t&&this.maybePushComponentsDestroyed(n),i}joinNewChildren(){Qe.findPhxChildren(this.el,this.id).forEach((e=>this.joinChild(e)))}getChildById(e){return this.root.children[this.id][e]}getDescendentByEl(e){return e.id===this.id?this:this.children[e.getAttribute(le)][e.id]}destroyDescendent(e){for(let t in this.root.children)for(let n in this.root.children[t])if(n===e)return this.root.children[t][n].destroy()}joinChild(e){if(!this.getChildById(e.id)){let t=new _t(e,this.liveSocket,this);return this.root.children[this.id][t.id]=t,t.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(e){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(),this.pendingJoinOps.forEach((([e,t])=>{e.isDestroyed()||t()})),this.pendingJoinOps=[]}update(e,t){if(this.isJoinPending()||this.liveSocket.hasPendingLink())return this.pendingDiffs.push({diff:e,events:t});this.rendered.mergeDiff(e);let n=!1;this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",(()=>{Qe.findParentCIDs(this.el,this.rendered.componentCIDs(e)).forEach((t=>{this.componentPatch(this.rendered.getComponent(e,t),t)&&(n=!0)}))})):je(e)||this.liveSocket.time("full patch complete",(()=>{let t=this.renderContainer(e,"update"),i=new dt(this,this.el,this.id,t,null);n=this.performPatch(i,!0)})),this.dispatchEvents(t),n&&this.joinNewChildren()}renderContainer(e,t){return this.liveSocket.time(`toString diff (${t})`,(()=>{let t=this.el.tagName,n=e?this.rendered.componentCIDs(e).concat(this.pruningCIDs):null;return`<${t}>${this.rendered.toString(n)}`}))}componentPatch(e,t){if(je(e))return!1;let n=this.rendered.componentToString(t),i=new dt(this,this.el,this.id,n,t);return this.performPatch(i,!0)}getHook(e){return this.viewHooks[ft.elementID(e)]}addHook(e){if(ft.elementID(e)||!e.getAttribute)return;let t=e.getAttribute("data-phx-hook")||e.getAttribute(this.binding(Se));if(t&&!this.ownsElement(e))return;let n=this.liveSocket.getHookCallbacks(t);if(n){e.id||Be(`no DOM ID for hook "${t}". Hooks require a unique ID on each element.`,e);let i=new ft(this,e,n);return this.viewHooks[ft.elementID(i.el)]=i,i}null!==t&&Be(`unknown hook found for "${t}"`,e)}destroyHook(e){e.__destroyed(),e.__cleanup__(),delete this.viewHooks[ft.elementID(e.el)]}applyPendingUpdates(){this.pendingDiffs.forEach((({diff:e,events:t})=>this.update(e,t))),this.pendingDiffs=[]}onChannel(e,t){this.liveSocket.onChannel(this.channel,e,(e=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>t(e)]):t(e)}))}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",(e=>{this.applyDiff("update",e,(({diff:e,events:t})=>this.update(e,t)))})),this.onChannel("redirect",(({to:e,flash:t})=>this.onRedirect({to:e,flash:t}))),this.onChannel("live_patch",(e=>this.onLivePatch(e))),this.onChannel("live_redirect",(e=>this.onLiveRedirect(e))),this.channel.onError((e=>this.onError(e))),this.channel.onClose((e=>this.onClose(e)))}destroyAllChildren(){for(let e in this.root.children[this.id])this.getChildById(e).destroy()}onLiveRedirect(e){let{to:t,kind:n,flash:i}=e,o=this.expandURL(t);this.liveSocket.historyRedirect(o,n,i)}onLivePatch(e){let{to:t,kind:n}=e;this.href=this.expandURL(t),this.liveSocket.historyPatch(t,n)}expandURL(e){return e.startsWith("/")?`${window.location.protocol}//${window.location.host}${e}`:e}onRedirect({to:e,flash:t}){this.liveSocket.redirect(e,t)}isDestroyed(){return this.destroyed}join(e){this.parent||(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=()=>e&&e(this.joinCount),this.liveSocket.wrapPush(this,{timeout:!1},(()=>this.channel.join().receive("ok",(e=>!this.isDestroyed()&&this.onJoin(e))).receive("error",(e=>!this.isDestroyed()&&this.onJoinError(e))).receive("timeout",(()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))))}onJoinError(e){return"unauthorized"===e.reason||"stale"===e.reason?(this.log("error",(()=>["unauthorized live_redirect. Falling back to page request",e])),this.onRedirect({to:this.href})):((e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect?this.onRedirect(e.redirect):e.live_redirect?this.onLiveRedirect(e.live_redirect):(this.log("error",(()=>["unable to join",e])),this.liveSocket.reloadWithJitter(this)))}onClose(e){if(!this.isDestroyed()){if(this.isJoinPending()&&"hidden"!==document.visibilityState||this.liveSocket.hasPendingLink()&&"leave"!==e)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}onError(e){this.onClose(e),this.log("error",(()=>["view crashed",e])),this.liveSocket.isUnloaded()||this.displayError()}displayError(){this.isMain()&&Qe.dispatchEvent(window,"phx:page-loading-start",{to:this.href,kind:"error"}),this.showLoader(),this.setContainerClasses(re,ae)}pushWithReply(e,t,n,i=function(){}){if(!this.isConnected())return;let[o,[r]]=e?e():[null,[]],s=function(){};return r&&null!==r.getAttribute(this.binding(ie))&&(s=this.liveSocket.withPageLoading({kind:"element",target:r})),"number"!=typeof n.cid&&delete n.cid,this.liveSocket.wrapPush(this,{timeout:!0},(()=>this.channel.push(t,n,3e4).receive("ok",(e=>{let t=null;null!==o&&this.undoRefs(o),e.diff&&(t=this.applyDiff("update",e.diff,(({diff:e,events:t})=>{this.update(e,t)}))),e.redirect&&this.onRedirect(e.redirect),e.live_patch&&this.onLivePatch(e.live_patch),e.live_redirect&&this.onLiveRedirect(e.live_redirect),s(),i(e,t)}))))}undoRefs(e){Qe.all(this.el,`[${G}="${e}"]`,(e=>{let t=e.getAttribute(ye);e.removeAttribute(G),null!==e.getAttribute(be)&&(e.readOnly=!1,e.removeAttribute(be)),null!==t&&(e.disabled="true"===t,e.removeAttribute(ye)),$.forEach((t=>Qe.removeClass(e,t)));let n=e.getAttribute(we);null!==n&&(e.innerText=n,e.removeAttribute(we));let i=Qe.private(e,G);if(i){let t=this.triggerBeforeUpdateHook(e,i);dt.patchEl(e,i,this.liveSocket.getActiveElement()),t&&t.__updated(),Qe.deletePrivate(e,G)}}))}putRef(e,t){let n=this.ref++,i=this.binding(Ce);return e.forEach((e=>{e.classList.add(`phx-${t}-loading`),e.setAttribute(G,n);let o=e.getAttribute(i);null!==o&&(e.getAttribute(we)||e.setAttribute(we,e.innerText),e.innerText=o)})),[n,e]}componentID(e){let t=e.getAttribute&&e.getAttribute(q);return t?parseInt(t):null}targetComponentID(e,t){return e.getAttribute(this.binding("target"))?this.closestComponentID(t):null}closestComponentID(e){return e?$e(e.closest(`[${q}]`),(e=>this.ownsElement(e)&&this.componentID(e))):null}pushHookEvent(e,t,n,i){if(!this.isConnected())return this.log("hook",(()=>["unable to push hook event. LiveView not connected",t,n])),!1;let[o,r]=this.putRef([],"hook");return this.pushWithReply((()=>[o,r]),"event",{type:"hook",event:t,value:n,cid:this.closestComponentID(e)},((e,t)=>i(t,o))),o}extractMeta(e,t){let n=this.binding("value-");for(let i=0;i=0&&!e.checked&&delete t.value),t}pushEvent(e,t,n,i,o){this.pushWithReply((()=>this.putRef([t],e)),"event",{type:e,event:i,value:this.extractMeta(t,o),cid:this.targetComponentID(t,n)})}pushKey(e,t,n,i,o){this.pushWithReply((()=>this.putRef([e],n)),"event",{type:n,event:i,value:this.extractMeta(e,o),cid:this.targetComponentID(e,t)})}pushFileProgress(e,t,n,i=function(){}){this.liveSocket.withinOwners(e.form,((o,r)=>{o.pushWithReply(null,"progress",{event:e.getAttribute(o.binding("progress")),ref:e.getAttribute(Q),entry_ref:t,progress:n,cid:o.targetComponentID(e.form,r)},i)}))}pushInput(e,t,n,i,o,r){let s,a=ze(n)?n:this.targetComponentID(e.form,t),l=()=>this.putRef([e,e.form],"change"),c=mt(e.form,{_target:o.name});e.files&&e.files.length>0&&Je.trackFiles(e,Array.from(e.files)),s=Je.serializeUploads(e);let u={type:"form",event:i,value:c,uploads:s,cid:a};this.pushWithReply(l,"event",u,(n=>{if(Qe.showError(e,this.liveSocket.binding(he)),Qe.isUploadInput(e)&&null!==e.getAttribute("data-phx-auto-upload")){if(Je.filesAwaitingPreflight(e).length>0){let[i,o]=l();this.uploadFiles(e.form,t,i,a,(t=>{r&&r(n),this.triggerAwaitingSubmit(e.form)}))}}else r&&r(n)}))}triggerAwaitingSubmit(e){let t=this.getScheduledSubmit(e);if(t){let[n,i,o]=t;this.cancelSubmit(e),o()}}getScheduledSubmit(e){return this.formSubmits.find((([t,n])=>t.isSameNode(e)))}scheduleSubmit(e,t,n){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,t,n])}cancelSubmit(e){this.formSubmits=this.formSubmits.filter((([t,n,i])=>!t.isSameNode(e)||(this.undoRefs(n),!1)))}pushFormSubmit(e,t,n,i){let o=e=>!(Ve(e,`${this.binding(xe)}=ignore`,e.form)||Ve(e,"data-phx-update=ignore",e.form)),r=e=>e.hasAttribute(this.binding(Ce)),s=e=>"BUTTON"==e.tagName,a=e=>["INPUT","TEXTAREA","SELECT"].includes(e.tagName),l=()=>{let t=Array.from(e.elements),n=t.filter(r),i=t.filter(s).filter(o),l=t.filter(a).filter(o);return i.forEach((e=>{e.setAttribute(ye,e.disabled),e.disabled=!0})),l.forEach((e=>{e.setAttribute(be,e.readOnly),e.readOnly=!0,e.files&&(e.setAttribute(ye,e.disabled),e.disabled=!0)})),e.setAttribute(this.binding(ie),""),this.putRef([e].concat(n).concat(i).concat(l),"submit")},c=this.targetComponentID(e,t);if(Je.hasUploadsInProgress(e)){let[o,r]=l();return this.scheduleSubmit(e,o,(()=>this.pushFormSubmit(e,t,n,i)))}if(Je.inputsAwaitingPreflight(e).length>0){let[o,r]=l(),s=()=>[o,r];this.uploadFiles(e,t,o,c,(t=>{let o=mt(e,{});this.pushWithReply(s,"event",{type:"form",event:n,value:o,cid:c},i)}))}else{let t=mt(e);this.pushWithReply(l,"event",{type:"form",event:n,value:t,cid:c},i)}}uploadFiles(e,t,n,i,o){let r=this.joinCount,s=Je.activeFileInputs(e),a=s.length;s.forEach((e=>{let i=new Je(e,this,(()=>{a--,0===a&&o()}));this.uploaders[e]=i;let s=i.entries().map((e=>e.toPreflightPayload())),l={ref:e.getAttribute(Q),entries:s,cid:this.targetComponentID(e.form,t)};this.log("upload",(()=>["sending preflight request",l])),this.pushWithReply(null,"allow_upload",l,(e=>{if(this.log("upload",(()=>["got preflight response",e])),e.error){this.undoRefs(n);let[t,i]=e.error;this.log("upload",(()=>[`error for entry ${t}`,i]))}else{let t=e=>{this.channel.onError((()=>{this.joinCount===r&&e()}))};i.initAdapterUpload(e,t,this.liveSocket)}}))}))}dispatchUploads(e,t){let n=Qe.findUploadInputs(this.el).filter((t=>t.name===e));0===n.length?Be(`no live file inputs found matching the name "${e}"`):n.length>1?Be(`duplicate live file inputs found matching the name "${e}"`):Qe.dispatchEvent(n[0],Y,{files:t})}pushFormRecovery(e,t,n){this.liveSocket.withinOwners(e,((i,o)=>{let r=e.elements[0],s=e.getAttribute(this.binding(ke))||e.getAttribute(this.binding("change"));i.pushInput(r,o,t,s,r,n)}))}pushLinkPatch(e,t,n){let i=this.liveSocket.setPendingLink(e),o=t?()=>this.putRef([t],"click"):null;this.pushWithReply(o,"live_patch",{url:e},(t=>{t.link_redirect?this.liveSocket.replaceMain(e,null,n,i):(this.liveSocket.commitPendingLink(i)&&(this.href=e),this.applyPendingUpdates(),n&&n(i))})).receive("timeout",(()=>this.liveSocket.redirect(window.location.href)))}formsForRecovery(e){if(0===this.joinCount)return[];let t=this.binding("change"),n=document.createElement("template");return n.innerHTML=e,Qe.all(this.el,`form[${t}]`).filter((e=>e.id&&this.ownsElement(e))).filter((e=>e.elements.length>0)).filter((e=>"ignore"!==e.getAttribute(this.binding(ke)))).map((e=>{let i=n.content.querySelector(`form[id="${e.id}"][${t}="${e.getAttribute(t)}"]`);return i?[e,i,this.componentID(i)]:[e,null,null]})).filter((([e,t,n])=>t))}maybePushComponentsDestroyed(e){let t=e.filter((e=>0===Qe.findComponentNodeList(this.el,e).length));t.length>0&&(this.pruningCIDs.push(...t),this.pushWithReply(null,"cids_will_destroy",{cids:t},(()=>{this.pruningCIDs=this.pruningCIDs.filter((e=>-1!==t.indexOf(e)));let e=t.filter((e=>0===Qe.findComponentNodeList(this.el,e).length));e.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:e},(e=>{this.rendered.pruneCIDs(e.cids)}))})))}ownsElement(e){return e.getAttribute(le)===this.id||$e(e.closest(_e),(e=>e.id))===this.id}submitForm(e,t,n){Qe.putPrivate(e,fe,!0),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(e,t,n,(()=>{this.liveSocket.restorePreviouslyActiveFocus()}))}binding(e){return this.liveSocket.binding(e)}};function vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.hasAttribute(t))throw new Error("Missing attribute '".concat(t,"' on element <").concat(e.tagName,":").concat(e.id,">"));var i=e.getAttribute(t);return n?n(i):i}function bt(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=e.hasAttribute(t)?e.getAttribute(t):n;return i?i(o):o}function yt(e){if("true"===e)return!0;if("false"===e)return!1;throw new Error("Invalid boolean attribute ".concat(e,', should be either "true" or "false"'))}function Ct(e){var t=parseInt(e,10);if(Number.isNaN(t))throw new Error("Invalid integer value ".concat(e));return t}var wt={mounted:function(){var e=this;this.props=St(this),this.__updateAttribute(),this.el.addEventListener("input",(function(t){e.__updateAttribute()})),this.el.addEventListener("paste",(function(e){e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)})),this.el.addEventListener("keydown",(function(t){"Enter"!==t.key&&"Escape"!==t.key||e.el.blur()})),this.el.addEventListener("focus",(function(t){e.el.setAttribute("phx-update","ignore")})),this.el.addEventListener("blur",(function(t){e.el.removeAttribute("phx-update")}))},updated:function(){this.props=St(this),this.__updateAttribute()},__updateAttribute:function(){var e=this.el.innerText.trim();this.el.setAttribute(this.props.attribute,e)}};function St(e){return{attribute:vt(e.el,"data-update-attribute")}}const xt=wt;var kt=n(158),Et=n(4565);function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n"===It(o)){var r=e.slice(t+1).filter((function(e){return!Ot(e)})).find((function(e){return Tt(e)===i}));if(r){var s=Nt(At(r),1)[0];if(["after","else","catch","rescue","end"].includes(s))return!1}return!0}return!1}(n,i)){var s=t.lineNumber|[\w:]+/g)||[]}function It(e){return e[e.length-1]}function Ot(e){return""===e.trim()}const Mt=Dt;kt.languages.registerOnTypeFormattingEditProvider("elixir",Mt),kt.editor.defineTheme("custom",{base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"#abb2bf"},{token:"variable",foreground:"#e06c75"},{token:"constant",foreground:"#61afef"},{token:"constant.character.escape",foreground:"#61afef"},{token:"comment",foreground:"#5c6370"},{token:"number",foreground:"#61afef"},{token:"regexp",foreground:"#e06c75"},{token:"type",foreground:"#e06c75"},{token:"string",foreground:"#98c379"},{token:"keyword",foreground:"#c678dd"},{token:"operator",foreground:"#d19a66"},{token:"delimiter.bracket.embed",foreground:"#be5046"},{token:"sigil",foreground:"#56b6c2"},{token:"function",foreground:"#61afef"},{token:"function.call",foreground:"#abb2bf"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"keyword.md",foreground:"#e06c75"},{token:"keyword.table",foreground:"#e06c75"},{token:"string.link.md",foreground:"#61afef"},{token:"variable.md",foreground:"#56b6c2"},{token:"string.md",foreground:"#abb2bf"},{token:"variable.source.md",foreground:"#abb2bf"}],colors:{"editor.background":"#282c34","editor.foreground":"#abb2bf","editorLineNumber.foreground":"#636d83","editorCursor.foreground":"#636d83","editor.selectionBackground":"#3e4451","editor.findMatchHighlightBackground":"#528bff3D","editorSuggestWidget.background":"#21252b","editorSuggestWidget.border":"#181a1f","editorSuggestWidget.selectedBackground":"#2c313a","input.background":"#1b1d23","input.border":"#181a1f","editorBracketMatch.border":"#282c34","editorBracketMatch.background":"#3e4451"}}),document.fonts.addEventListener("loadingdone",(function(e){e.fontfaces.some((function(e){return e.family.includes("JetBrains Mono")}))&&kt.editor.remeasureFonts()})),kt.languages.registerCompletionItemProvider("elixir",{provideCompletionItems:function(e,t,n,i){return e.__getCompletionItems?e.__getCompletionItems(e,t):null}}),kt.languages.registerHoverProvider("elixir",{provideHover:function(e,t,n){return e.__getHover?e.__getHover(e,t):null}}),kt.languages.registerDocumentFormattingEditProvider("elixir",{provideDocumentFormattingEdits:function(e,t,n){return e.__getDocumentFormattingEdits?e.__getDocumentFormattingEdits(e):null}});const Rt=kt;function Pt(e,t){return kt.editor.colorize(e,t).then((function(e){return e.replace(/$/,"")}))}function Ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:5e3;Ft(this,e),this.client=t,this.reportRevisionTimeoutId=null,this.reportRevisionTimeout=n}return zt(e,[{key:"onClientDelta",value:function(e){return null!==this.reportRevisionTimeoutId&&(clearTimeout(this.reportRevisionTimeoutId),this.reportRevisionTimeoutId=null),this.client.sendDelta(e),new Vt(this.client,e)}},{key:"onServerDelta",value:function(e){var t=this;return this.client.applyDelta(e),null===this.reportRevisionTimeoutId&&(this.reportRevisionTimeoutId=setTimeout((function(){t.client.reportCurrentRevision(),t.reportRevisionTimeoutId=null}),this.reportRevisionTimeout)),this}},{key:"onServerAcknowledgement",value:function(){throw new Error("Unexpected server acknowledgement.")}}]),e}(),Vt=function(){function e(t,n){Ft(this,e),this.client=t,this.awaitedDelta=n}return zt(e,[{key:"onClientDelta",value:function(e){return new Ut(this.client,this.awaitedDelta,e)}},{key:"onServerDelta",value:function(t){var n=this.awaitedDelta.transform(t,"right");this.client.applyDelta(n);var i=t.transform(this.awaitedDelta,"left");return new e(this.client,i)}},{key:"onServerAcknowledgement",value:function(){return new Wt(this.client)}}]),e}(),Ut=function(){function e(t,n,i){Ft(this,e),this.client=t,this.awaitedDelta=n,this.buffer=i}return zt(e,[{key:"onClientDelta",value:function(t){var n=this.buffer.compose(t);return new e(this.client,this.awaitedDelta,n)}},{key:"onServerDelta",value:function(t){var n=this.awaitedDelta.transform(t,"right"),i=this.buffer.transform(n,"right");this.client.applyDelta(i);var o=t.transform(this.awaitedDelta,"left"),r=n.transform(this.buffer,"left");return new e(this.client,o,r)}},{key:"onServerAcknowledgement",value:function(){return this.client.sendDelta(this.buffer),new Vt(this.client,this.buffer)}}]),e}();function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $t(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];jt(this,e),this.ops=t}return qt(e,[{key:"retain",value:function(e){return e<=0?this:this.append({retain:e})}},{key:"insert",value:function(e){return""===e?this:this.append({insert:e})}},{key:"delete",value:function(e){return e<=0?this:this.append({delete:e})}},{key:"append",value:function(e){if(0===this.ops.length)return this.ops.push(e),this;var t=this.ops.pop();return Qt(e)&&Xt(t)?this.append(e).append(t):Qt(e)&&Qt(t)?(this.ops.push({insert:t.insert+e.insert}),this):Xt(e)&&Xt(t)?(this.ops.push({delete:t.delete+e.delete}),this):Zt(e)&&Zt(t)?(this.ops.push({retain:t.retain+e.retain}),this):(this.ops.push(t,e),this)}},{key:"compose",value:function(t){for(var n=new Gt(this.ops),i=new Gt(t.ops),o=new e;n.hasNext()||i.hasNext();)if(Qt(i.peek()))o.append(i.next());else if(Xt(n.peek()))o.append(n.next());else{var r=Math.min(n.peekLength(),i.peekLength()),s=n.next(r),a=i.next(r);Zt(a)?o.append(s):Xt(a)&&Zt(s)&&o.append(a)}return o.__trim()}},{key:"transform",value:function(t,n){if("left"!==n&&"right"!==n)throw new Error('Invalid priority "'.concat(n,'", should be either "left" or "right"'));for(var i=new Gt(this.ops),o=new Gt(t.ops),r=new e;i.hasNext()||o.hasNext();)if(!Qt(i.peek())||Qt(o.peek())&&"left"!==n)if(Qt(o.peek()))r.append(o.next());else{var s=Math.min(i.peekLength(),o.peekLength()),a=i.next(s),l=o.next(s);if(Xt(a))continue;Xt(l)?r.append(l):r.retain(s)}else{var c=Yt(i.next());r.retain(c)}return r.__trim()}},{key:"__trim",value:function(){return this.ops.length>0&&Zt(this.ops[this.ops.length-1])&&this.ops.pop(),this}},{key:"toCompressed",value:function(){return this.ops.map((function(e){if(Qt(e))return e.insert;if(Zt(e))return e.retain;if(Xt(e))return-e.delete;throw new Error("Invalid operation ".concat(e))}))}},{key:"applyToString",value:function(e){var t="",n=0;return this.ops.forEach((function(i){Zt(i)&&(t+=e.slice(n,n+i.retain),n+=i.retain),Qt(i)&&(t+=i.insert),Xt(i)&&(n+=i.delete)})),t+=e.slice(n)}}],[{key:"fromCompressed",value:function(e){return e.reduce((function(e,t){if("string"==typeof t)return e.insert(t);if("number"==typeof t&&t>=0)return e.retain(t);if("number"==typeof t&&t<0)return e.delete(-t);throw new Error("Invalid compressed operation ".concat(t))}),new this)}}]),e}(),Gt=function(){function e(t){jt(this,e),this.ops=t,this.index=0,this.offset=0}return qt(e,[{key:"hasNext",value:function(){return this.peekLength()<1/0}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,t=this.ops[this.index];if(!t)return{retain:e};var n=this.offset,i=Yt(t);return e>=i-n?(e=i-n,this.index+=1,this.offset=0):this.offset+=e,Xt(t)?{delete:e}:Zt(t)?{retain:e}:Qt(t)?{insert:t.insert.substr(n,e)}:void 0}},{key:"peek",value:function(){return this.ops[this.index]||{retain:1/0}}},{key:"peekLength",value:function(){return this.ops[this.index]?Yt(this.ops[this.index])-this.offset:1/0}}]),e}();function Yt(e){return Qt(e)?e.insert.length:Zt(e)?e.retain:Xt(e)?e.delete:void 0}function Qt(e){return"string"==typeof e.insert}function Zt(e){return"number"==typeof e.retain}function Xt(e){return"number"==typeof e.delete}function Jt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&e.editor.layout()}))}));t.observe(this.container),this.editor.onDidContentSizeChange((function(){var t=e.editor.getContentHeight();e.container.style.height="".concat(t,"px")})),function(e,t,n){var i,o=null!==(i=Et.P.getCommand(t))&&void 0!==i?i:{},r=o.handler,s=o.when;r&&e._standaloneKeybindingService.addDynamicKeybinding(t,n,r,s)}(this.editor,"editor.action.showHover",Rt.KeyMod.CtrlCmd|Rt.KeyCode.KEY_I)}},{key:"__setupIntellisense",value:function(){var e=this;this.handlerByRef={},this.editor.getModel().__getCompletionItems=function(t,n){var i=t.getLineContent(n.lineNumber).slice(0,n.column-1);return e.__asyncIntellisenseRequest("completion",{hint:i}).then((function(e){var t,o=(t=e.items,t.map(kn).map((function(e,n){return Cn(Cn({},e),{},{sortText:Nn(n,t.length)})}))).map((function(e){var t=function(e,t){for(var n=t;!e.endsWith(n);)n=n.slice(0,-1);return n.length}(i,e.insertText),o=new Rt.Range(n.lineNumber,n.column-t,n.lineNumber,n.column);return Cn(Cn({},e),{},{range:o})}));return{suggestions:o}})).catch((function(){return null}))},this.editor.getModel().__getHover=function(t,n){var i=t.getLineContent(n.lineNumber),o=n.column;return e.__asyncIntellisenseRequest("details",{line:i,column:o}).then((function(e){var t=e.contents.map((function(e){return{value:e,isTrusted:!0}}));return{contents:t,range:new Rt.Range(n.lineNumber,e.range.from,n.lineNumber,e.range.to)}})).catch((function(){return null}))},this.editor.getModel().__getDocumentFormattingEdits=function(t){var n=t.getValue();return e.__asyncIntellisenseRequest("format",{code:n}).then((function(e){return[{range:t.getFullModelRange(),text:e.code}]})).catch((function(){return null}))},this.hook.handleEvent("intellisense_response",(function(t){var n=t.ref,i=t.response,o=e.handlerByRef[n];o&&(o(i),delete e.handlerByRef[n])}))}},{key:"__asyncIntellisenseRequest",value:function(e,t){var n=this;return new Promise((function(i,o){n.hook.pushEvent("intellisense_request",Cn({cell_id:n.cellId,type:e},t),(function(e){var t=e.ref;t?n.handlerByRef[t]=function(e){e?i(e):o(null)}:o(null)}))}))}}],n&&Sn(t.prototype,n),e}();function kn(e){return{label:e.label,kind:En(e.kind),detail:e.detail,documentation:e.documentation&&{value:e.documentation,isTrusted:!0},insertText:e.insert_text}}function En(e){switch(e){case"function":return Rt.languages.CompletionItemKind.Function;case"module":return Rt.languages.CompletionItemKind.Module;case"struct":return Rt.languages.CompletionItemKind.Struct;case"interface":return Rt.languages.CompletionItemKind.Interface;case"type":return Rt.languages.CompletionItemKind.Class;case"variable":return Rt.languages.CompletionItemKind.Variable;case"field":return Rt.languages.CompletionItemKind.Field;default:return null}}function Nn(e,t){return String(e).padStart(t,"0")}const Ln=xn;var Dn,Tn="undefined"==typeof document?void 0:document,An=!!Tn&&"content"in Tn.createElement("template"),In=!!Tn&&Tn.createRange&&"createContextualFragment"in Tn.createRange();function On(e,t){var n,i,o=e.nodeName,r=t.nodeName;return o===r||(n=o.charCodeAt(0),i=r.charCodeAt(0),n<=90&&i>=97?o===r.toUpperCase():i<=90&&n>=97&&r===o.toUpperCase())}function Mn(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Rn={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}Mn(e,t,"selected")},INPUT:function(e,t){Mn(e,t,"checked"),Mn(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var o=i.nodeValue;if(o==n||!n&&o==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,o=-1,r=0,s=e.firstChild;s;)if("OPTGROUP"===(i=s.nodeName&&s.nodeName.toUpperCase()))s=(n=s).firstChild;else{if("OPTION"===i){if(s.hasAttribute("selected")){o=r;break}r++}!(s=s.nextSibling)&&n&&(s=n.nextSibling,n=null)}e.selectedIndex=o}}};function Pn(){}function Fn(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var Bn=function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var i=t;(t=Tn.createElement("html")).innerHTML=i}else o=(o=t).trim(),t=An?function(e){var t=Tn.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(o):In?function(e){return Dn||(Dn=Tn.createRange()).selectNode(Tn.body),Dn.createContextualFragment(e).childNodes[0]}(o):function(e){var t=Tn.createElement("body");return t.innerHTML=e,t.childNodes[0]}(o);var o,r=n.getNodeKey||Fn,s=n.onBeforeNodeAdded||Pn,a=n.onNodeAdded||Pn,l=n.onBeforeElUpdated||Pn,c=n.onElUpdated||Pn,u=n.onBeforeNodeDiscarded||Pn,h=n.onNodeDiscarded||Pn,d=n.onBeforeElChildrenUpdated||Pn,g=!0===n.childrenOnly,p=Object.create(null),f=[];function m(e){f.push(e)}function _(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var i=void 0;t&&(i=r(n))?m(i):(h(n),n.firstChild&&_(n,t)),n=n.nextSibling}}function v(e,t,n){!1!==u(e)&&(t&&t.removeChild(e),h(e),_(e,n))}function b(e){a(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=r(t);if(i){var o=p[i];o&&On(t,o)?(t.parentNode.replaceChild(o,t),y(o,t)):b(t)}else b(t);t=n}}function y(e,t,n){var i=r(t);if(i&&delete p[i],!n){if(!1===l(e,t))return;if(function(e,t){var n,i,o,r,s=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var a=s.length-1;a>=0;a--)i=(n=s[a]).name,o=n.namespaceURI,r=n.value,o?(i=n.localName||i,e.getAttributeNS(o,i)!==r&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(o,i,r))):e.getAttribute(i)!==r&&e.setAttribute(i,r);for(var l=e.attributes,c=l.length-1;c>=0;c--)i=(n=l[c]).name,(o=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}}(e,t),c(e),!1===d(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,i,o,a,l,c=t.firstChild,u=e.firstChild;e:for(;c;){for(a=c.nextSibling,n=r(c);u;){if(o=u.nextSibling,c.isSameNode&&c.isSameNode(u)){c=a,u=o;continue e}i=r(u);var h=u.nodeType,d=void 0;if(h===c.nodeType&&(1===h?(n?n!==i&&((l=p[n])?o===l?d=!1:(e.insertBefore(l,u),i?m(i):v(u,e,!0),u=l):d=!1):i&&(d=!1),(d=!1!==d&&On(u,c))&&y(u,c)):3!==h&&8!=h||(d=!0,u.nodeValue!==c.nodeValue&&(u.nodeValue=c.nodeValue))),d){c=a,u=o;continue e}i?m(i):v(u,e,!0),u=o}if(n&&(l=p[n])&&On(l,c))e.appendChild(l),y(l,c);else{var g=s(c);!1!==g&&(g&&(c=g),c.actualize&&(c=c.actualize(e.ownerDocument||Tn)),e.appendChild(c),b(c))}c=a,u=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=r(t))?m(n):v(t,e,!0),t=i}}(e,u,i);var f=Rn[e.nodeName];f&&f(e,t)}(e,t):Rn.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=r(n);i&&(p[i]=n),e(n),n=n.nextSibling}}(e);var C,w,S=e,x=S.nodeType,k=t.nodeType;if(!g)if(1===x)1===k?On(e,t)||(h(e),S=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(e,(C=t.nodeName,(w=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==w?Tn.createElementNS(w,C):Tn.createElement(C)))):S=t;else if(3===x||8===x){if(k===x)return S.nodeValue!==t.nodeValue&&(S.nodeValue=t.nodeValue),S;S=t}if(S===t)h(e);else{if(t.isSameNode&&t.isSameNode(S))return;if(y(S,t,g),f)for(var E=0,N=f.length;Ee.length){for(;r--;)if(47===e.charCodeAt(r)){if(n){i=r+1;break}}else o<0&&(n=!0,o=r+1);return o<0?"":e.slice(i,o)}if(t===e)return"";let s=-1,a=t.length-1;for(;r--;)if(47===e.charCodeAt(r)){if(n){i=r+1;break}}else s<0&&(n=!0,s=r+1),a>-1&&(e.charCodeAt(r)===t.charCodeAt(a--)?a<0&&(o=r):(a=-1,o=s));return i===o?o=s:o<0&&(o=e.length),e.slice(i,o)},Zn=function(e){if(ti(e),0===e.length)return".";let t,n=-1,i=e.length;for(;--i;)if(47===e.charCodeAt(i)){if(t){n=i;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},Xn=function(e){ti(e);let t,n=e.length,i=-1,o=0,r=-1,s=0;for(;n--;){const a=e.charCodeAt(n);if(47!==a)i<0&&(t=!0,i=n+1),46===a?r<0?r=n:1!==s&&(s=1):r>-1&&(s=-1);else if(t){o=n+1;break}}return r<0||i<0||0===s||1===s&&r===i-1&&r===o+1?"":e.slice(r,i)},Jn=function(...e){let t,n=-1;for(;++n2){if(i=o.lastIndexOf("/"),i!==o.length-1){i<0?(o="",r=0):(o=o.slice(0,i),r=o.length-1-o.lastIndexOf("/")),s=l,a=0;continue}}else if(o.length>0){o="",r=0,s=l,a=0;continue}t&&(o=o.length>0?o+"/..":"..",r=2)}else o.length>0?o+="/"+e.slice(s+1,l):o=e.slice(s+1,l),r=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},ei="/";function ti(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ni=function(){return"/"};function ii(e){return null!==e&&"object"==typeof e&&e.href&&e.origin}const oi=["history","path","basename","stem","extname","dirname"];class ri{constructor(e){let t;t=e?"string"==typeof e||Wn(e)?{value:e}:ii(e)?{path:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=ni(),this.value,this.stored,this.result,this.map;let n,i=-1;for(;++it.length;let s;r&&t.push(i);try{s=e(...t)}catch(e){const t=e;if(r&&n)throw t;return i(t)}r||(s instanceof Promise?s.then(o,i):s instanceof Error?i(s):o(s))};function i(e,...i){n||(n=!0,t(e,...i))}function o(e){i(null,e)}}(a,o)(...s):i(null,...s)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}(),n=[];let i,o={},r=-1;return s.data=function(e,t){return"string"==typeof e?2===arguments.length?(pi("data",i),o[e]=t,s):ui.call(o,e)&&o[e]||null:e?(pi("data",i),o=e,s):o},s.Parser=void 0,s.Compiler=void 0,s.freeze=function(){if(i)return s;for(;++r{if(!e&&t&&n){const i=s.stringify(t,n);null==i||(function(e){return"string"==typeof e||Wn(e)}(i)?n.value=i:n.result=i),r(e,n)}else r(e)}))}n(null,t)},s.processSync=function(e){let t;s.freeze(),di("processSync",s.Parser),gi("processSync",s.Compiler);const n=_i(e);return s.process(n,(function(e){t=!0,Hn(e)})),mi("processSync","process",t),n},s;function s(){const t=e();let i=-1;for(;++io?0:o+t:t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),[].splice.apply(e,r);else for(n&&[].splice.apply(e,[t,n]);s0?(yi(e,e.length,0,t),e):t}const wi={}.hasOwnProperty;function Si(e){const t={};let n=-1;for(;++nr))return;const n=t.events.length;let o,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){a=t.events[l][1].end;break}o=!0}for(_(s),e=n;ei;){const i=n[o];t.containerState=i[1],i[0].exit.call(t,e)}n.length=i}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}},Vi={tokenize:function(e,t,n){return zi(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},Ui={tokenize:function(e,t,n){return zi(e,(function(e){return null===e||Mi(e)?t(e):n(e)}),"linePrefix")},partial:!0};function ji(e){const t={};let n,i,o,r,s,a,l,c=-1;for(;++c=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}},partial:!0},Gi={tokenize:function(e){const t=this,n=e.attempt(Ui,(function(i){if(null!==i)return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(i)}),e.attempt(this.parser.constructs.flowInitial,i,zi(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qi,i)),"linePrefix")));return n;function i(i){if(null!==i)return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(i)}}},Yi={resolveAll:Ji()},Qi=Xi("string"),Zi=Xi("text");function Xi(e){return{tokenize:function(t){const n=this,i=this.parser.constructs[e],o=t.attempt(i,r,s);return r;function r(e){return l(e)?o(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=i[e];let o=-1;if(t)for(;++o-1&&(s[0]=s[0].slice(i)),r>0&&s.push(e[o].slice(0,r))),s}(s,e)}function p(){return Object.assign({},i)}function f(e){l=void 0,h=e,d=d(e)}function m(e,t){t.restore()}function _(e,t){return function(n,o,r){let s,h,d,g;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return function(t){const n=null!==t&&e[t],i=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(i)?i:i?[i]:[]])(t)}}(n);function f(e){return s=e,h=0,0===e.length?r:m(e[h])}function m(e){return function(n){return g=function(){const e=p(),t=u.previous,n=u.currentConstruct,o=u.events.length,r=Array.from(a);return{restore:function(){i=e,u.previous=t,u.currentConstruct=n,u.events.length=o,a=r,b()},from:o}}(),d=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,_,v)(n)}}function _(t){return l=!0,e(d,g),o}function v(e){return l=!0,g.restore(),++hc?n(o):(e.consume(o),p):41===o?u--?(e.consume(o),p):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(o)):null===o||Oi(o)?u?n(o):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(o)):Ii(o)?n(o):(e.consume(o),92===o?f:p)}function f(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function co(e,t,n,i,o,r){const s=this;let a,l=0;return function(t){return e.enter(i),e.enter(o),e.consume(t),e.exit(o),e.enter(r),c};function c(h){return null===h||91===h||93===h&&!a||94===h&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(h):93===h?(e.exit(r),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Mi(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||Mi(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a=a||!Ri(t),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function uo(e,t,n,i,o,r){let s;return function(t){return e.enter(i),e.enter(o),e.consume(t),e.exit(o),s=40===t?41:t,a};function a(n){return n===s?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),t):(e.enter(r),l(n))}function l(t){return t===s?(e.exit(r),a(s)):null===t?n(t):Mi(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),zi(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||Mi(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function ho(e,t){let n;return function i(o){return Mi(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ri(o)?zi(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}function go(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const po={name:"definition",tokenize:function(e,t,n){const i=this;let o;return function(t){return e.enter("definition"),co.call(i,e,r,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function r(t){return o=go(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),ho(e,lo(e,e.attempt(fo,zi(e,s,"whitespace"),zi(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(t)}function s(r){return null===r||Mi(r)?(e.exit("definition"),i.parser.defined.includes(o)||i.parser.defined.push(o),t(r)):n(r)}}},fo={tokenize:function(e,t,n){return function(t){return Oi(t)?ho(e,i)(t):n(t)};function i(t){return 34===t||39===t||40===t?uo(e,zi(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):n(t)}function o(e){return null===e||Mi(e)?t(e):n(e)}},partial:!0},mo={name:"codeIndented",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("codeIndented"),zi(e,o,"linePrefix",5)(t)};function o(e){const t=i.events[i.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?r(e):n(e)}function r(t){return null===t?a(t):Mi(t)?e.attempt(_o,r,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||Mi(t)?(e.exit("codeFlowValue"),r(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},_o={tokenize:function(e,t,n){const i=this;return o;function o(t){return i.parser.lazy[i.now().line]?n(t):Mi(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):zi(e,r,"linePrefix",5)(t)}function r(e){const r=i.events[i.events.length-1];return r&&"linePrefix"===r[1].type&&r[2].sliceSerialize(r[1],!0).length>=4?t(e):Mi(e)?o(e):n(e)}},partial:!0},vo={name:"headingAtx",tokenize:function(e,t,n){const i=this;let o=0;return function(t){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),r(t)};function r(a){return 35===a&&o++<6?(e.consume(a),r):null===a||Oi(a)?(e.exit("atxHeadingSequence"),i.interrupt?t(a):s(a)):n(a)}function s(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||Mi(n)?(e.exit("atxHeading"),t(n)):Ri(n)?zi(e,s,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),s(t))}function l(t){return null===t||35===t||Oi(t)?(e.exit("atxHeadingText"),s(t)):(e.consume(t),l)}},resolve:function(e,t){let n,i,o=e.length-2,r=3;return"whitespace"===e[r][1].type&&(r+=2),o-2>r&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(r===o-1||o-4>r&&"whitespace"===e[o-2][1].type)&&(o-=r+1===o?2:4),o>r&&(n={type:"atxHeadingText",start:e[r][1].start,end:e[o][1].end},i={type:"chunkText",start:e[r][1].start,end:e[o][1].end,contentType:"text"},yi(e,r,o-r+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e}},bo={name:"setextUnderline",tokenize:function(e,t,n){const i=this;let o,r,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){r="paragraph"===i.events[s][1].type;break}return function(t){return i.parser.lazy[i.now().line]||!i.interrupt&&!r?n(t):(e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),o=t,a(t))};function a(t){return t===o?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),zi(e,l,"lineSuffix")(t))}function l(i){return null===i||Mi(i)?(e.exit("setextHeadingLine"),t(i)):n(i)}},resolveTo:function(e,t){let n,i,o,r=e.length;for(;r--;)if("enter"===e[r][0]){if("content"===e[r][1].type){n=r;break}"paragraph"===e[r][1].type&&(i=r)}else"content"===e[r][1].type&&e.splice(r,1),o||"definition"!==e[r][1].type||(o=r);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}},yo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Co=["pre","script","style","textarea"],wo={name:"htmlFlow",tokenize:function(e,t,n){const i=this;let o,r,s,a,l;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),g):63===a?(e.consume(a),o=3,i.interrupt?t:M):Ei(a)?(e.consume(a),s=String.fromCharCode(a),r=!0,p):n(a)}function u(r){return 45===r?(e.consume(r),o=2,h):91===r?(e.consume(r),o=5,s="CDATA[",a=0,d):Ei(r)?(e.consume(r),o=4,i.interrupt?t:M):n(r)}function h(o){return 45===o?(e.consume(o),i.interrupt?t:M):n(o)}function d(o){return o===s.charCodeAt(a++)?(e.consume(o),a===s.length?i.interrupt?t:E:d):n(o)}function g(t){return Ei(t)?(e.consume(t),s=String.fromCharCode(t),p):n(t)}function p(a){return null===a||47===a||62===a||Oi(a)?47!==a&&r&&Co.includes(s.toLowerCase())?(o=1,i.interrupt?t(a):E(a)):yo.includes(s.toLowerCase())?(o=6,47===a?(e.consume(a),f):i.interrupt?t(a):E(a)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(a):r?_(a):m(a)):45===a||Di(a)?(e.consume(a),s+=String.fromCharCode(a),p):n(a)}function f(o){return 62===o?(e.consume(o),i.interrupt?t:E):n(o)}function m(t){return Ri(t)?(e.consume(t),m):x(t)}function _(t){return 47===t?(e.consume(t),x):58===t||95===t||Ei(t)?(e.consume(t),v):Ri(t)?(e.consume(t),_):x(t)}function v(t){return 45===t||46===t||58===t||95===t||Di(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),y):Ri(t)?(e.consume(t),b):_(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,C):Ri(t)?(e.consume(t),y):(l=null,w(t))}function C(t){return null===t||Mi(t)?n(t):t===l?(e.consume(t),S):(e.consume(t),C)}function w(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||Oi(t)?b(t):(e.consume(t),w)}function S(e){return 47===e||62===e||Ri(e)?_(e):n(e)}function x(t){return 62===t?(e.consume(t),k):n(t)}function k(t){return Ri(t)?(e.consume(t),k):null===t||Mi(t)?E(t):n(t)}function E(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),A):62===t&&4===o?(e.consume(t),R):63===t&&3===o?(e.consume(t),M):93===t&&5===o?(e.consume(t),O):!Mi(t)||6!==o&&7!==o?null===t||Mi(t)?N(t):(e.consume(t),E):e.check(So,R,N)(t)}function N(t){return e.exit("htmlFlowData"),L(t)}function L(t){return null===t?P(t):Mi(t)?e.attempt({tokenize:D,partial:!0},L,P)(t):(e.enter("htmlFlowData"),E(t))}function D(e,t,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}function T(t){return 45===t?(e.consume(t),M):E(t)}function A(t){return 47===t?(e.consume(t),s="",I):E(t)}function I(t){return 62===t&&Co.includes(s.toLowerCase())?(e.consume(t),R):Ei(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),I):E(t)}function O(t){return 93===t?(e.consume(t),M):E(t)}function M(t){return 62===t?(e.consume(t),R):45===t&&2===o?(e.consume(t),M):E(t)}function R(t){return null===t||Mi(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),R)}function P(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},So={tokenize:function(e,t,n){return function(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(Ui,t,n)}},partial:!0},xo={name:"codeFenced",tokenize:function(e,t,n){const i=this,o={tokenize:function(e,t,n){let i=0;return zi(e,(function(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),o(t)}),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(t){return t===l?(e.consume(t),i++,o):i1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const h=Object.assign({},e[n][1].end),d=Object.assign({},e[u][1].start);Fo(h,-a),Fo(d,a),r={type:a>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[n][1].end)},s={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[u][1].start),end:d},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[u][1].start)},i={type:a>1?"strong":"emphasis",start:Object.assign({},r.start),end:Object.assign({},s.end)},e[n][1].end=Object.assign({},r.start),e[u][1].start=Object.assign({},s.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Ci(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Ci(l,[["enter",i,t],["enter",r,t],["exit",r,t],["enter",o,t]]),l=Ci(l,to(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Ci(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Ci(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,yi(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++u13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}const er=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tr(e){return e.replace(er,nr)}function nr(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Jo(n.slice(t?2:1),t?16:10)}return Eo(n)||e}const ir={}.hasOwnProperty,or=function(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e={}){const t=rr({transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(C),autolinkProtocol:g,autolinkEmail:g,atxHeading:a(v),blockQuote:a((function(){return{type:"blockquote",children:[]}})),characterEscape:g,characterReference:g,codeFenced:a(_),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(_,l),codeText:a((function(){return{type:"inlineCode",value:""}}),l),codeTextData:g,data:g,codeFlowValue:g,definition:a((function(){return{type:"definition",identifier:"",label:null,title:null,url:""}})),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a((function(){return{type:"emphasis",children:[]}})),hardBreakEscape:a(b),hardBreakTrailing:a(b),htmlFlow:a(y,l),htmlFlowData:g,htmlText:a(y,l),htmlTextData:g,image:a((function(){return{type:"image",title:null,url:"",alt:null}})),label:l,link:a(C),listItem:a((function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}})),listItemValue:function(e){r("expectingFirstListItemValue")&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),o("expectingFirstListItemValue"))},listOrdered:a(w,(function(){o("expectingFirstListItemValue",!0)})),listUnordered:a(w),paragraph:a((function(){return{type:"paragraph",children:[]}})),reference:function(){o("referenceType","collapsed")},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(v),strong:a((function(){return{type:"strong",children:[]}})),thematicBreak:a((function(){return{type:"thematicBreak"}}))},exit:{atxHeading:u(),atxHeadingSequence:function(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}},autolink:u(),autolinkEmail:function(e){p.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){p.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:u(),characterEscapeValue:p,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(e){const t=this.sliceSerialize(e),n=r("characterReferenceType");let i;n?(i=Jo(t,"characterReferenceMarkerNumeric"===n?10:16),o("characterReferenceType")):i=Eo(t);const a=this.stack.pop();a.value+=i,a.position.end=s(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")})),codeFencedFence:function(){r("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:p,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:p,data:p,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=go(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(f),hardBreakTrailing:u(f),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:p,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:p,image:u((function(){const e=this.stack[this.stack.length-1];r("inReference")?(e.type+="Reference",e.referenceType=r("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label),o("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];o("inReference",!0),"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){const t=this.stack[this.stack.length-2],n=this.sliceSerialize(e);t.label=tr(n),t.identifier=go(n).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(r("atHardBreak"))return n.children[n.children.length-1].position.end=s(e.end),void o("atHardBreak");!r("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(g.call(this,e),p.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];r("inReference")?(e.type+="Reference",e.referenceType=r("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label),o("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=go(this.sliceSerialize(e)).toLowerCase(),o("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){o("inReference")},setextHeading:u((function(){o("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){o("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}},e.mdastExtensions||[]),n={};return function(e){let n={type:"root",children:[]};const a=[],u=[],g={stack:[n],tokenStack:a,config:t,enter:c,exit:h,buffer:l,resume:d,setData:o,getData:r};let p=-1;for(;++p0)throw new Error("Cannot close document, a token (`"+a[a.length-1].type+"`, "+$n({start:a[a.length-1].start,end:a[a.length-1].end})+") is still open");for(n.position={start:s(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:s(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p{const n=this.data("settings");return or(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})},lr={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(t){return 87===t||119===t?(e.consume(t),o):n(t)}function o(t){return 87===t||119===t?(e.consume(t),r):n(t)}function r(t){return 46===t?(e.consume(t),s):n(t)}function s(e){return null===e||Mi(e)?n(e):t(e)}},partial:!0},cr={tokenize:function(e,t,n){let i,o;return r;function r(t){return 38===t?e.check(dr,a,s)(t):46===t||95===t?e.check(hr,a,s)(t):null===t||Ii(t)||Pi(t)||45!==t&&Fi(t)?a(t):(e.consume(t),r)}function s(t){return 46===t?(o=i,i=void 0,e.consume(t),r):(95===t&&(i=!0),e.consume(t),r)}function a(e){return o||i?n(e):t(e)}},partial:!0},ur={tokenize:function(e,t){let n=0;return i;function i(s){return 38===s?e.check(dr,t,o)(s):(40===s&&n++,41===s?e.check(hr,r,o)(s):yr(s)?t(s):br(s)?e.check(hr,t,o)(s):(e.consume(s),i))}function o(t){return e.consume(t),i}function r(e){return n--,n<0?t(e):o(e)}},partial:!0},hr={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(o){return br(o)?(e.consume(o),i):yr(o)?t(o):n(o)}},partial:!0},dr={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(t){return Ei(t)?(e.consume(t),i):59===t?(e.consume(t),o):n(t)}function o(e){return yr(e)?t(e):n(e)}},partial:!0},gr={tokenize:function(e,t,n){const i=this;return function(t){return 87!==t&&119!==t||!wr(i.previous)||kr(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(lr,e.attempt(cr,e.attempt(ur,o),n),n)(t))};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:wr},pr={tokenize:function(e,t,n){const i=this;return function(t){return 72!==t&&104!==t||!Sr(i.previous)||kr(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(t),o)};function o(t){return 84===t||116===t?(e.consume(t),r):n(t)}function r(t){return 84===t||116===t?(e.consume(t),s):n(t)}function s(t){return 80===t||112===t?(e.consume(t),a):n(t)}function a(t){return 83===t||115===t?(e.consume(t),l):l(t)}function l(t){return 58===t?(e.consume(t),c):n(t)}function c(t){return 47===t?(e.consume(t),u):n(t)}function u(t){return 47===t?(e.consume(t),h):n(t)}function h(t){return null===t||Ii(t)||Pi(t)||Fi(t)?n(t):e.attempt(cr,e.attempt(ur,d),n)(t)}function d(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:Sr},fr={tokenize:function(e,t,n){const i=this;let o,r;return function(t){return Cr(t)&&xr(i.previous)&&!kr(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(t)):n(t)};function s(t){return Cr(t)?(e.consume(t),s):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(hr,h,l)(t):45===t||95===t?e.check(hr,n,c)(t):Di(t)?(!r&&Ni(t)&&(r=!0),e.consume(t),a):h(t)}function l(t){return e.consume(t),o=!0,r=void 0,a}function c(t){return e.consume(t),u}function u(t){return 46===t?e.check(hr,n,l)(t):a(t)}function h(i){return o&&!r?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(i)):n(i)}},previous:xr},mr={},_r={text:mr};let vr=48;for(;vr<123;)mr[vr]=fr,vr++,58===vr?vr=65:91===vr&&(vr=97);function br(e){return 33===e||34===e||39===e||41===e||42===e||44===e||46===e||58===e||59===e||60===e||63===e||95===e||126===e}function yr(e){return null===e||60===e||Oi(e)}function Cr(e){return 43===e||45===e||46===e||95===e||Di(e)}function wr(e){return null===e||40===e||42===e||95===e||126===e||Oi(e)}function Sr(e){return null===e||!Ei(e)}function xr(e){return 47!==e&&Sr(e)}function kr(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if(("labelLink"===i.type||"labelImage"===i.type)&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}mr[43]=fr,mr[45]=fr,mr[46]=fr,mr[95]=fr,mr[72]=[fr,pr],mr[104]=[fr,pr],mr[87]=[fr,gr],mr[119]=[fr,gr];const Er={tokenize:function(e,t,n){const i=this;return zi(e,(function(e){const o=i.events[i.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function Nr(e,t,n){const i=this;let o=i.events.length;const r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;o--;){const e=i.events[o][1];if("labelImage"===e.type){s=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!s||!s._balanced)return n(o);const a=go(i.sliceSerialize({start:s.end,end:i.now()}));return 94===a.charCodeAt(0)&&r.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function Lr(e,t){let n,i=e.length;for(;i--;)if("labelImage"===e[i][1].type&&"enter"===e[i][0]){n=e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[i+1],e[i+2],["enter",o,t],e[i+3],e[i+4],["enter",r,t],["exit",r,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(i,e.length-i+1,...l),e}function Dr(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r,s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(a){let u;return null===a||91===a||s++>999?n(a):93===a?r?(e.exit("chunkString"),u=e.exit("gfmFootnoteCallString"),o.includes(go(i.sliceSerialize(u)))?function(n){return e.enter("gfmFootnoteCallLabelMarker"),e.consume(n),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t}(a):n(a)):n(a):(e.consume(a),Oi(a)||(r=!0),92===a?c:l)}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function Tr(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r,s,a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),c):n(t)}function c(t){let o;return null===t||91===t||a>999?n(t):93===t?s?(o=e.exit("gfmFootnoteDefinitionLabelString"),r=go(i.sliceSerialize(o)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d):n(t):Mi(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a++,c):(e.enter("chunkString").contentType="string",u(t))}function u(t){return null===t||Mi(t)||91===t||93===t||a>999?(e.exit("chunkString"),c(t)):(Oi(t)||(s=!0),a++,e.consume(t),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),a++,u):u(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),zi(e,g,"gfmFootnoteDefinitionWhitespace")):n(t)}function g(e){return o.includes(r)||o.push(r),t(e)}}function Ar(e,t,n){return e.check(Ui,t,e.attempt(Er,t,n))}function Ir(e){e.exit("gfmFootnoteDefinition")}function Or(e={}){let t=e.singleTilde;const n={tokenize:function(e,n,i){const o=this.previous,r=this.events;let s=0;return function(t){return 126===o&&"characterEscape"!==r[r.length-1][1].type?i(t):(e.enter("strikethroughSequenceTemporary"),a(t))};function a(r){const l=Ro(o);if(126===r)return s>1?i(r):(e.consume(r),s++,a);if(s<2&&!t)return i(r);const c=e.exit("strikethroughSequenceTemporary"),u=Ro(r);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(r)}},resolveAll:function(e,t){let n=-1;for(;++n":"")+")"})),h;function h(){var c,u,h,d=[];if((!t||o(s,a,l[l.length-1]||null))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(s,l)),!1===d[0]))return d;if(s.children&&"skip"!==d[0])for(u=(i?s.children.length:-1)+r,h=l.concat(s);u>-1&&ue}const Gr="phrasing",Yr=["autolink","link","image","label"],Qr={transforms:[function(e){!function(e,t,n,i){let o,r;"string"==typeof t||t instanceof RegExp?(r=[[t,n]],o=i):(r=t,o=n),o||(o={});const s=Wr(o.ignore||[]),a=function(e){const t=[];if("object"!=typeof e)throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let n=-1;for(;++n0?{type:"text",value:t}:void 0),!1!==t&&(r!==o&&c.push({type:"text",value:e.value.slice(r,o)}),Array.isArray(t)?c.push(...t):t&&c.push(t),r=o+u[0].length),!n.global)break;u=n.exec(e.value)}return void 0===o?(c=[e],s--):(r?\]}]+$/.exec(e);let n,i,o,r;if(t)for(e=e.slice(0,t.index),r=t[0],n=r.indexOf(")"),i=Hr(e,"("),o=Hr(e,")");-1!==n&&i>o;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[e,r]}(n+i);if(!s[0])return!1;const a={type:"link",title:null,url:r+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function es(e,t,n,i){return!(!ts(i,!0)||/[_-\d]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ts(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||Pi(n)||Fi(n))&&(!t||47!==n)}function ns(e){return e.label||!e.identifier?e.label||"":tr(e.identifier)}function is(e,t){const n=t.indexStack,i=e.children||[],o=[];let r=-1;for(n.push(-1);++r=c||e+1":"")+")"})),h;function h(){let c,u,h,d=[];if((!t||o(s,a,l[l.length-1]||null))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(s,l)),d[0]===ds))return d;if(s.children&&"skip"!==d[0])for(u=(i?s.children.length:-1)+r,h=l.concat(s);u>-1&&u for more info)"),ps=!0),fs||gs(e,"list",(()=>(console.warn("[mdast-util-gfm-footnote] Warning: Found a list in a footnote definition. GitHub currently crahes on lists in footnotes (see for more info)"),fs=!0,ds))),a},footnoteReference:e}};function e(e,t,n){const i=n.enter("footnoteReference"),o=n.enter("reference"),r=cs(n,ns(e),{before:"^",after:"]"});return o(),i(),"[^"+r+"]"}}function _s(e,t,n){const i=t.indexStack,o=e.children||[],r=[];let s=-1,a=n.before;for(i.push(-1);++s0&&("\r"===a||"\n"===a)&&"html"===l.type&&(r[r.length-1]=r[r.length-1].replace(/(\r?\n|\r)$/," "),a=" "),r.push(t.handle(l,e,t,{before:a,after:c})),a=r[r.length-1].slice(-1)}return i.pop(),r.join("")}const vs={canContainEols:["delete"],enter:{strikethrough:function(e){this.enter({type:"delete",children:[]},e)}},exit:{strikethrough:function(e){this.exit(e)}}},bs={unsafe:[{character:"~",inConstruct:"phrasing"}],handlers:{delete:ys}};function ys(e,t,n){const i=n.enter("emphasis"),o=_s(e,n,{before:"~",after:"~"});return i(),"~~"+o+"~~"}function Cs(e,t,n){let i=e.value||"",o="`",r=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++rb&&(b=e[s].length);++uc[u])&&(c[u]=g)),h.push(p);a[s]=h,l[s]=d}if(u=-1,"object"==typeof i&&"length"in i)for(;++uc[u]&&(c[u]=g),d[u]=g),h[u]=p;a.splice(1,0,h),l.splice(1,0,d),s=-1;const y=[];for(;++s-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let r=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(r=4*Math.ceil(r/4));const s=n.enter("listItem"),a=rs(is(e,n),(function(e,t,n){return t?(n?"":" ".repeat(r))+e:(n?o:o+" ".repeat(r-o.length))+e}));return s(),a}(e,t,n);return"boolean"==typeof e.checked&&i&&"paragraph"===i.type&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(t){return t+"["+(e.checked?"x":" ")+"] "}))),o}}};function Is(e){this.stack[this.stack.length-2].checked="taskListCheckValueChecked"===e.type}function Os(e={}){const t=this.data();function n(e,n){(t[e]?t[e]:t[e]=[]).push(n)}n("micromarkExtensions",function(e){return Si([_r,{document:{91:{tokenize:Tr,continuation:{tokenize:Ar},exit:Ir}},text:{91:{tokenize:Dr},93:{add:"after",tokenize:Nr,resolveTo:Lr}}},Or(e),Mr,Br])}(e)),n("fromMarkdownExtensions",[Qr,{enter:{gfmFootnoteDefinition:function(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)},gfmFootnoteDefinitionLabelString:function(){this.buffer()},gfmFootnoteCall:function(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)},gfmFootnoteCallString:function(){this.buffer()}},exit:{gfmFootnoteDefinition:function(e){this.exit(e)},gfmFootnoteDefinitionLabelString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=go(this.sliceSerialize(e)).toLowerCase()},gfmFootnoteCall:function(e){this.exit(e)},gfmFootnoteCallString:function(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=go(this.sliceSerialize(e)).toLowerCase()}}},vs,ks,Ts]),n("toMarkdownExtensions",function(e){return{extensions:[Zr,ms(),bs,Ds(e),As]}}(e))}const Ms={tokenize:function(e,t,n){const i=this,o=i.events[i.events.length-1],r=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0;let s=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),a(t)};function a(t){return 36===t?(e.consume(t),s++,a):(e.exit("mathFlowFenceSequence"),s<2?n(t):zi(e,l,"whitespace")(t))}function l(t){return null===t||Mi(t)?u(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return null===t||Mi(t)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),u(t)):36===t?n(t):(e.consume(t),c)}function u(n){return e.exit("mathFlowFence"),i.interrupt?t(n):h(n)}function h(t){return null===t?g(t):Mi(t)?e.attempt(Rs,e.attempt({tokenize:p,partial:!0},g,r?zi(e,h,"linePrefix",r+1):h),g)(t):(e.enter("mathFlowValue"),d(t))}function d(t){return null===t||Mi(t)?(e.exit("mathFlowValue"),h(t)):(e.consume(t),d)}function g(n){return e.exit("mathFlow"),t(n)}function p(e,t,n){let i=0;return zi(e,(function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),o(t)}),"linePrefix",4);function o(t){return 36===t?(e.consume(t),i++,o):is&&(s=r):r=1,o=i+1,i=n.indexOf(t,o);return s}(i,"$")+1,2)),r=n.enter("mathFlow");let s=o;if(e.meta){const t=n.enter("mathFlowMeta");s+=cs(n,e.meta,{before:"$",after:" ",encode:["$"]}),t()}return s+="\n",i&&(s+=i+"\n"),s+=o,r(),s},inlineMath:n}};function n(e){const n=e.value||"";let i=1,o="";for(t||i++;new RegExp("(^|[^$])"+"\\$".repeat(i)+"([^$]|$)").test(n);)i++;/[^ \r\n]/.test(n)&&(/[ \r\n$]/.test(n.charAt(0))||/[ \r\n$]/.test(n.charAt(n.length-1)))&&(o=" ");const r="$".repeat(i);return r+o+n+o+r}}(e))}var Hs=function(e,t,n){var i={type:String(e)};return null!=n||"string"!=typeof t&&!Array.isArray(t)?Object.assign(i,t):n=t,Array.isArray(n)?i.children=n:null!=n&&(i.value=String(n)),i},Ws=Us("start"),Vs=Us("end");function Us(e){return function(t){var n=t&&t.position&&t.position[e]||{};return{line:n.line||null,column:n.column||null,offset:n.offset>-1?n.offset:null}}}const js={}.hasOwnProperty;function $s(e){return String(e||"").toUpperCase()}const qs={}.hasOwnProperty;function Ks(e,t){const n=t.data||{};return"value"in t&&!(qs.call(n,"hName")||qs.call(n,"hProperties")||qs.call(n,"hChildren"))?e.augment(t,Hs("text",t.value)):e(t,"div",Qs(e,t))}function Gs(e,t,n){const i=t&&t.type;let o;if(!i)throw new Error("Expected node, got `"+t+"`");return o=qs.call(e.handlers,i)?e.handlers[i]:e.passThrough&&e.passThrough.includes(i)?Ys:e.unknownHandler,("function"==typeof o?o:Ks)(e,t,n)}function Ys(e,t){return"children"in t?{...t,children:Qs(e,t)}:t}function Qs(e,t){const n=[];if("children"in t){const i=t.children;let o=-1;for(;++o":"gt"};function Xs(e,t){const n=function(e){return e.replace(/["&<>]/g,(function(e){return"&"+Zs[e]+";"}))}(function(e){const t=[];let n=-1,i=0,o=0;for(;++n55295&&r<57344){const t=e.charCodeAt(n+1);r<56320&&t>56319&&t<57344?(s=String.fromCharCode(r,t),o=1):s="�"}else s=String.fromCharCode(r);s&&(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}(e||""));if(!t)return n;const i=n.indexOf(":"),o=n.indexOf("?"),r=n.indexOf("#"),s=n.indexOf("/");return i<0||s>-1&&i>s||o>-1&&i>o||r>-1&&i>r||t.test(n.slice(0,i))?n:""}function Js(e,t){const n=[];let i=-1;for(t&&n.push(Hs("text","\n"));++i0&&n.push(Hs("text","\n")),n}function ea(e,t){const n=String(t.identifier),i=Xs(n.toLowerCase()),o=e.footnoteOrder.indexOf(n);let r;-1===o?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,r=e.footnoteOrder.length):(e.footnoteCounts[n]++,r=o+1);const s=e.footnoteCounts[n];return e(t,"sup",[e(t.position,"a",{href:"#"+e.clobberPrefix+"fn-"+i,id:e.clobberPrefix+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:"footnote-label"},[Hs("text",String(r))])])}var ta=n(729);function na(e,t){const n=t.referenceType;let i="]";if("collapsed"===n?i+="[]":"full"===n&&(i+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return Hs("text","!["+t.alt+i);const o=Qs(e,t),r=o[0];r&&"text"===r.type?r.value="["+r.value:o.unshift(Hs("text","["));const s=o[o.length-1];return s&&"text"===s.type?s.value+=i:o.push(Hs("text",i)),o}function ia(e){const t=e.spread;return null==t?e.children.length>1:t}const oa={blockquote:function(e,t){return e(t,"blockquote",Js(Qs(e,t),!0))},break:function(e,t){return[e(t,"br"),Hs("text","\n")]},code:function(e,t){const n=t.value?t.value+"\n":"",i=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),o={};i&&(o.className=["language-"+i]);const r=e(t,"code",o,[Hs("text",n)]);return t.meta&&(r.data={meta:t.meta}),e(t.position,"pre",[r])},delete:function(e,t){return e(t,"del",Qs(e,t))},emphasis:function(e,t){return e(t,"em",Qs(e,t))},footnoteReference:ea,footnote:function(e,t){const n=e.footnoteById;let i=1;for(;i in n;)i++;const o=String(i);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},ea(e,{type:"footnoteReference",identifier:o,position:t.position})},heading:function(e,t){return e(t,"h"+t.depth,Qs(e,t))},html:function(e,t){return e.dangerous?e.augment(t,Hs("raw",t.value)):null},imageReference:function(e,t){const n=e.definition(t.identifier);if(!n)return na(e,t);const i={src:ta(n.url||""),alt:t.alt};return null!==n.title&&void 0!==n.title&&(i.title=n.title),e(t,"img",i)},image:function(e,t){const n={src:ta(t.url),alt:t.alt};return null!==t.title&&void 0!==t.title&&(n.title=t.title),e(t,"img",n)},inlineCode:function(e,t){return e(t,"code",[Hs("text",t.value.replace(/\r?\n|\r/g," "))])},linkReference:function(e,t){const n=e.definition(t.identifier);if(!n)return na(e,t);const i={href:ta(n.url||"")};return null!==n.title&&void 0!==n.title&&(i.title=n.title),e(t,"a",i,Qs(e,t))},link:function(e,t){const n={href:ta(t.url)};return null!==t.title&&void 0!==t.title&&(n.title=t.title),e(t,"a",n,Qs(e,t))},listItem:function(e,t,n){const i=Qs(e,t),o=n?function(e){let t=e.spread;const n=e.children;let i=-1;for(;!t&&++i0&&n.children.unshift(Hs("text"," ")),n.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),r.className=["task-list-item"]}let a=-1;for(;++a{const t=String(e.identifier).toUpperCase();sa.call(o,t)||(o[t]=e)})),s;function r(e,t){if(e&&"data"in e&&e.data){const n=e.data;n.hName&&("element"!==t.type&&(t={type:"element",tagName:"",properties:{},children:[]}),t.tagName=n.hName),"element"===t.type&&n.hProperties&&(t.properties={...t.properties,...n.hProperties}),"children"in t&&t.children&&n.hChildren&&(t.children=n.hChildren)}if(e){const i="type"in e?e:{position:e};(n=i)&&n.position&&n.position.start&&n.position.start.line&&n.position.start.column&&n.position.end&&n.position.end.line&&n.position.end.column&&(t.position={start:Ws(i),end:Vs(i)})}var n;return t}function s(e,t,n,i){return Array.isArray(n)&&(i=n,n={}),r(e,{type:"element",tagName:t,properties:n||{},children:i||[]})}}(e,t),i=Gs(n,e,null),o=function(e){let t=-1;const n=[];for(;++t1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&t.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(t)}const c=o[o.length-1];if(c&&"element"===c.type&&"p"===c.tagName){const e=c.children[c.children.length-1];e&&"text"===e.type?e.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else o.push(...l);const u={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+s},children:Js(o,!0)};i.position&&(u.position=i.position),n.push(u)}return 0===n.length?null:{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:"h2",properties:{id:"footnote-label",className:["sr-only"]},children:[Hs("text",e.footnoteLabel)]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:Js(n,!0)},{type:"text",value:"\n"}]}}(n);return o&&i.children.push(Hs("text","\n"),o),Array.isArray(i)?{type:"root",children:i}:i}const la=function(e,t){return e&&"run"in e?function(e,t){return(n,i,o)=>{e.run(aa(n,t),i,(e=>{o(e)}))}}(e,t):function(e){return t=>aa(t,e)}(e||t)};var ca=n(7045);class ua{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function ha(e,t){for(var n={},i={},o=-1;++o4&&"data"===n.slice(0,4)&&Ba.test(t)&&("-"===t.charAt(4)?i=function(e){var t=e.slice(5).replace(za,Ua);return"data"+t.charAt(0).toUpperCase()+t.slice(1)}(t):t=function(e){var t=e.slice(4);return za.test(t)?e:("-"!==(t=t.replace(Ha,Va)).charAt(0)&&(t="-"+t),"data"+t)}(t),o=xa),new o(i,t))}function Va(e){return"-"+e.toLowerCase()}function Ua(e){return e.charAt(1).toUpperCase()}var ja=/[#.]/g;function $a(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function qa(e){return e.join(" ").trim()}function Ka(e){for(var t,n,i=[],o=String(e||""),r=o.indexOf(","),s=0;!t;)-1===r&&(r=o.length,t=!0),!(n=o.slice(s,r).trim())&&t||i.push(n),s=r+1,r=o.indexOf(",",s);return i}function Ga(e,t){var n=t||{};return""===e[e.length-1]&&(e=e.concat("")),e.join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const Ya=new Set(["menu","submit","reset","button"]),Qa={}.hasOwnProperty;function Za(e,t,n){const i=n&&function(e){const t={};let n=-1;for(;++n-1&&ee)return{line:t+1,column:e-(n[t-1]||0)+1,offset:e};return{line:void 0,column:void 0,offset:void 0}},toOffset:function(e){var t,i=e&&e.line,o=e&&e.column;return"number"!=typeof i||"number"!=typeof o||Number.isNaN(i)||Number.isNaN(o)||!(i-1 in n)||(t=(n[i-2]||0)+o-1||0),t>-1&&t0?e.call(t,r,s,a):e.call(t,r,s)}function Cl(e,t,n,i,o){const r=Wa(i.schema,t);let s;null==n||"number"==typeof n&&Number.isNaN(n)||!1===n&&(i.vue||i.vdom||i.hyperscript)||!n&&r.boolean&&(i.vue||i.vdom||i.hyperscript)||(Array.isArray(n)&&(n=r.commaSeparated?Ga(n):qa(n)),r.boolean&&i.hyperscript&&(n=""),"style"===r.property&&"string"==typeof n&&(i.react||i.vue||i.vdom)&&(n=function(e,t){const n={};try{dl(e,((e,t)=>{"-ms-"===e.slice(0,4)&&(e="ms-"+e.slice(4)),n[e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase()))]=t}))}catch(e){throw e.message=t+"[style]"+e.message.slice("undefined".length),e}return n}(n,o)),i.vue?"style"!==r.property&&(s="attrs"):r.mustUseProperty||(i.vdom?"style"!==r.property&&(s="attributes"):i.hyperscript&&(s="attrs")),s?e[s]=Object.assign(e[s]||{},{[r.attribute]:n}):r.space&&i.react?e[pl[r.property]||r.property]=n:e[r.attribute]=n)}function wl(e){return"context"in e&&"cleanup"in e}var Sl={}.hasOwnProperty;function xl(e,t){var n=t||{};function i(t){var n=i.invalid,o=i.handlers;if(t&&Sl.call(t,e)&&(n=Sl.call(o,t[e])?o[t[e]]:i.unknown),n)return n.apply(this,arguments)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}var kl={}.hasOwnProperty,El=xl("type",{handlers:{root:function(e,t){var n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Nl(e.children,n,t),Ll(e,n)},element:function(e,t){var n=t.space;return bl((function(n,i){var o,r,s,a,l,c=[];for(s in i)kl.call(i,s)&&!1!==i[s]&&((o=Wa(t,s)).boolean&&!i[s]||(r={name:s,value:!0===i[s]?"":String(i[s])},o.space&&"html"!==o.space&&"svg"!==o.space&&((a=s.indexOf(":"))<0?r.prefix="":(r.name=s.slice(a+1),r.prefix=s.slice(0,a)),r.namespace=il[o.space]),c.push(r)));return"html"===t.space&&"svg"===e.tagName&&(t=Fa),(l=Ll(e,{nodeName:n,tagName:n,attrs:c,namespaceURI:il[t.space],childNodes:[],parentNode:void 0})).childNodes=Nl(e.children,l,t),"template"===n&&(l.content=function(e,t){var n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Nl(e.children,n,t),Ll(e,n)}(e.content,t)),l}),Object.assign({},e,{children:[]}),{space:n})},text:function(e){return Ll(e,{nodeName:"#text",value:e.value,parentNode:void 0})},comment:function(e){return Ll(e,{nodeName:"#comment",data:e.value,parentNode:void 0})},doctype:function(e){return Ll(e,{nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:void 0})}}});function Nl(e,t,n){var i,o=-1,r=[];if(e)for(;++o{const i=e;if(i.value.stitch&&null!==n&&null!==t)return n.children[t]=i.value.stitch,t})),"root"!==e.type&&"root"===h.type&&1===h.children.length?h.children[0]:h;function d(e){let t=-1;if(e)for(;++tAl(t,n,e)}var Pl=n(527);const Fl=function(e,t,n,i,o){const r=Bl(t);if(null!=n&&("number"!=typeof n||n<0||n===Number.POSITIVE_INFINITY))throw new Error("Expected positive finite index for child node");if(!(null==i||i.type&&i.children))throw new Error("Expected parent node");if(!e||!e.type||"string"!=typeof e.type)return!1;if(null==i!=(null==n))throw new Error("Expected both parent and index");return r.call(o,e,n,i)},Bl=function(e){if(null==e)return Hl;if("string"==typeof e)return t=e,function(e){return Hl(e)&&e.tagName===t};var t;if("object"==typeof e)return function(e){const t=[];let n=-1;for(;++n`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `--\x3e` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `` in ``",description:"Unexpected text character `%c`. Only use text in `