typeof JSON!="undefined"&&(window._vwdJSON=JSON);typeof define!="undefined"&&(window._vwdDefine=define,define=null);typeof onbeforeunload!="undefined"&&(window._vwdonbeforeunload=window.onbeforeunload); ; /* NUGET: BEGIN LICENSE TEXT * * Microsoft grants you the right to use these script files for the sole * purpose of either: (i) interacting through your browser with the Microsoft * website or online service, subject to the applicable licensing or use * terms; or (ii) using the files as included with a Microsoft product subject * to that product's license terms. Microsoft reserves all other rights to the * files not expressly granted by Microsoft, whether by implication, estoppel * or otherwise. Insofar as a script file is dual licensed under GPL, * Microsoft neither took the code under GPL nor distributes it thereunder but * under the terms set out in this paragraph. All notices and licenses * below are for informational purposes only. * * JQUERY CORE 1.8.2; Copyright 2012 jQuery Foundation and other contributors; http://jquery.org/license * Includes Sizzle CSS Selector Engine; Copyright 2012 jQuery Foundation and other contributors; http://opensource.org/licenses/MIT * * NUGET: END LICENSE TEXT */ /*! jQuery v1.8.2 jquery.com | jquery.org/license */ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
t
",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="

",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); ; /* NUGET: BEGIN LICENSE TEXT * * Microsoft grants you the right to use these script files for the sole * purpose of either: (i) interacting through your browser with the Microsoft * website or online service, subject to the applicable licensing or use * terms; or (ii) using the files as included with a Microsoft product subject * to that product's license terms. Microsoft reserves all other rights to the * files not expressly granted by Microsoft, whether by implication, estoppel * or otherwise. Insofar as a script file is dual licensed under GPL, * Microsoft neither took the code under GPL nor distributes it thereunder but * under the terms set out in this paragraph. All notices and licenses * below are for informational purposes only. * * ASP.NET SignalR JavaScript Library v2.0.2; Copyright (C) Microsoft Corporation; https://github.com/SignalR/SignalR/blob/master/LICENSE.md * * NUGET: END LICENSE TEXT */ /*! * ASP.NET SignalR JavaScript Library v2.0.2 * http://signalr.net/ * * Copyright (C) Microsoft Corporation. All rights reserved. * */ (function(n,t,i){"use strict";function p(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function w(n){return n==="http:"?80:n==="https:"?443:void 0}function l(n,t){return t.match(/:\d+$/)?t:t+":"+w(n)}function b(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting."};if(typeof n!="function")throw new Error(f.nojQuery);var r,h,s=t.document.readyState==="complete",e=n(t),c="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},a=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},v=function(n){return n.state===r.connectionState.disconnected},y=function(n){var i,u;n._.configuredStopReconnectingTimeout||(u=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting.");n.stop(!1,!1)},n.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(i=t.setTimeout(function(){u(n)},n.disconnectTimeout))}),n.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(i)}),n._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this._={keepAliveData:{},connectingMessageBuffer:new b(this,function(n){f.triggerHandler(u.onReceived,[n])}),onFailedTimeoutHandle:null,lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+l(u.protocol,u.host)!==r.protocol+l(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.3",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var l=this,a={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},k,v=l._deferral||n.Deferred(),w=t.document.createElement("a"),b,d;if(l._deferral=v,!l.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(a,i),n.type(a.callback)==="function"&&(h=a.callback)),a.transport=p(a.transport,l),!a.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(l._.config=a,!s&&a.waitForPageLoad===!0)?(l._.deferredStartHandler=function(){l.start(i,h)},e.bind("load",l._.deferredStartHandler),v.promise()):l.state===r.connectionState.connecting?v.promise():o(l,r.connectionState.disconnected,r.connectionState.connecting)===!1?(v.resolve(l),v.promise()):(y(l),w.href=l.url,w.protocol&&w.protocol!==":"?(l.protocol=w.protocol,l.host=w.host,l.baseUrl=w.protocol+"//"+w.host):(l.protocol=t.document.location.protocol,l.host=t.document.location.host,l.baseUrl=l.protocol+"//"+l.host),l.wsProtocol=l.protocol==="https:"?"wss://":"ws://",a.transport==="auto"&&a.jsonp===!0&&(a.transport="longPolling"),l.url.indexOf("//")===0&&(l.url=t.location.protocol+l.url,l.log("Protocol relative URL detected, normalizing it to '"+l.url+"'.")),this.isCrossDomain(l.url)&&(l.log("Auto detected cross domain url."),a.transport==="auto"&&(a.transport=["webSockets","longPolling"]),typeof a.withCredentials=="undefined"&&(a.withCredentials=!0),a.jsonp||(a.jsonp=!n.support.cors,a.jsonp&&l.log("Using jsonp because this browser doesn't support CORS.")),l.contentType=r._.defaultContentType),l.withCredentials=a.withCredentials,l.ajaxDataType=a.jsonp?"jsonp":"text",n(l).bind(u.onStart,function(){n.type(h)==="function"&&h.call(l);v.resolve(l)}),k=function(i,s){var y=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){n(l).triggerHandler(u.onError,[y]);v.reject(y);l.stop();return}if(l.state!==r.connectionState.disconnected){var p=i[s],h=r.transports[p],c=!1,a=function(){c||(c=!0,t.clearTimeout(l._.onFailedTimeoutHandle),h.stop(l),k(i,s+1))};l.transport=h;try{l._.onFailedTimeoutHandle=t.setTimeout(function(){l.log(h.name+" timed out when trying to connect.");a()},l.transportConnectTimeout);h.start(l,function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!l.withCredentials&&i;l.state!==r.connectionState.disconnected&&(c||(c=!0,t.clearTimeout(l._.onFailedTimeoutHandle),h.supportsKeepAlive&&l._.keepAliveData.activated&&r.transports._logic.monitorKeepAlive(l),r.transports._logic.startHeartbeat(l),r._.configurePingInterval(l),o(l,r.connectionState.connecting,r.connectionState.connected),l._.connectingMessageBuffer.drain(),n(l).triggerHandler(u.onStart),e.bind("unload",function(){l.log("Window unloading, stopping the connection.");l.stop(f)}),i&&e.bind("beforeunload",function(){t.setTimeout(function(){l.stop(f)},0)})))},a)}catch(w){l.log(h.name+" transport threw '"+w.message+"' when attempting to start.");a()}}},b=l.url+"/negotiate",d=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);v.reject(e);i.stop()},n(l).triggerHandler(u.onStarting),b=r.transports._logic.prepareQueryString(l,b),b=r.transports._logic.addQs(b,{clientProtocol:l.clientProtocol}),l.log("Negotiating with '"+b+"'."),l._.negotiateRequest=n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:l.withCredentials},url:b,type:"GET",contentType:l.contentType,data:{},dataType:l.ajaxDataType,error:function(n,t){t!==c?d(n,l):v.reject(r._.error(f.stoppedWhileNegotiating,null,l._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=l._parseResponse(t)}catch(c){d(r._.error(f.errorParsingNegotiateResponse,c),l);return}if(e=l._.keepAliveData,l.appRelativeUrl=i.Url,l.id=i.ConnectionId,l.token=i.ConnectionToken,l.webSocketServerUrl=i.WebSocketServerUrl,l.disconnectTimeout=i.DisconnectTimeout*1e3,l.transportConnectTimeout=l.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*l.keepAliveWarnAt,l._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,l.reconnectWindow=l.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==l.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,l.clientProtocol,i.ProtocolVersion));n(l).triggerHandler(u.onError,[h]);v.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(a.transport)?n.each(a.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):a.transport==="auto"?o=s:n.inArray(a.transport,s)>=0&&o.push(a.transport);k(o)}})),v.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var l=this,a=l._deferral;if(l._.deferredStartHandler&&e.unbind("load",l._.deferredStartHandler),delete l._deferral,delete l._.config,delete l._.deferredStartHandler,!s&&(!l._.config||l._.config.waitForPageLoad===!0)){l.log("Stopping connection prior to negotiate.");a&&a.reject(r._.error(f.stoppedWhileLoading));return}if(l.state!==r.connectionState.disconnected)return l.log("Stopping connection."),o(l,l.state,r.connectionState.disconnected),t.clearTimeout(l._.beatHandle),t.clearTimeout(l._.onFailedTimeoutHandle),t.clearInterval(l._.pingIntervalId),l.transport&&(l.transport.stop(l),h!==!1&&l.transport.abort(l,i),l.transport.supportsKeepAlive&&l._.keepAliveData.activated&&r.transports._logic.stopMonitoringKeepAlive(l),l.transport=null),l._.negotiateRequest&&(l._.negotiateRequest.abort(c),delete l._.negotiateRequest),n(l).triggerHandler(u.onDisconnect),delete l.messageId,delete l.groupsToken,delete l.id,delete l._.pingIntervalId,delete l._.lastMessageAt,delete l._.lastActiveAt,l._.connectingMessageBuffer.clear(),l},log:function(n){a(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=h),r};n.connection&&(h=n.connection);n.connection=n.signalR=r})(window.jQuery,window),function(n,t){"use strict";function f(n){n._.keepAliveData.monitoring&&o(n);r.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){f(n)},n._.beatInterval))}function o(t){var r=t._.keepAliveData,f;t.state===i.connectionState.connected&&(f=(new Date).getTime()-t._.lastMessageAt,f>=r.timeout?(t.log("Keep alive timed out. Notifying transport that connection has been lost."),t.transport.lostConnection(t)):f>=r.timeoutWarning?r.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(u.onConnectionSlow),r.userNotified=!0):r.userNotified=!1)}function s(n){return n.state===i.connectionState.connected||n.state===i.connectionState.reconnecting}function h(n,i){var r=n.indexOf("?")!==-1?"&":"?";return i&&(n+=r+"connectionData="+t.encodeURIComponent(i)),n}var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r;i.transports={};r=i.transports._logic={pingServer:function(t){var e,u=n.Deferred(),f;return t.transport?(e=t.url+"/ping",e=r.addQs(e,t.qs),f=n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:t.withCredentials},url:e,type:"GET",contentType:t.contentType,data:{},dataType:t.ajaxDataType,success:function(n){var r;try{r=t._parseResponse(n)}catch(e){u.reject(i._.transportError(i.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}r.Response==="pong"?u.resolve():u.reject(i._.transportError(i._.format(i.resources.pingServerFailedInvalidResponse,n.responseText),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(u.reject(i._.transportError(i._.format(i.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):u.reject(i._.transportError(i.resources.pingServerFailed,t.transport,n,f))}}))):u.reject(i._.transportError(i.resources.noConnectionTransport,t.transport)),u.promise()},prepareQueryString:function(n,t){return t=r.addQs(t,n.qs),h(t,n.data)},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,u,f){var s=i==="webSockets"?"":n.baseUrl,e=s+n.appRelativeUrl,o="transport="+i+"&connectionToken="+t.encodeURIComponent(n.token);return n.groupsToken&&(o+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),u?(e+=f?"/poll":"/reconnect",n.messageId&&(o+="&messageId="+t.encodeURIComponent(n.messageId))):e+="/connect",e+="?"+o,e=r.prepareQueryString(n,e),e+("&tid="+Math.floor(Math.random()*11))},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,Disconnect:typeof n.D!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(f,e){var c=r.stringifySend(f,e),o=f.url+"/send?transport="+f.transport.name+"&connectionToken="+t.encodeURIComponent(f.token),s,h=function(t,r){n(r).triggerHandler(u.onError,[i._.transportError(i.resources.sendFailed,r.transport,t,s),e])};return o=r.prepareQueryString(f,o),s=n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:f.withCredentials},url:o,type:f.ajaxDataType==="jsonp"?"GET":"POST",contentType:i._.defaultContentType,dataType:f.ajaxDataType,data:{data:c},success:function(n){var t;if(n){try{t=f._parseResponse(n)}catch(i){h(i,f);f.stop();return}r.triggerReceived(f,t)}},error:function(n,t){t!=="abort"&&t!=="parsererror"&&h(n,f)}}))},ajaxAbort:function(i,u){if(typeof i.transport!="undefined"){u=typeof u=="undefined"?!0:u;var f=i.url+"/abort?transport="+i.transport.name+"&connectionToken="+t.encodeURIComponent(i.token);f=r.prepareQueryString(i,f);n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:i.withCredentials},url:f,async:u,timeout:1e3,type:"POST",contentType:i.contentType,dataType:i.ajaxDataType,data:{}}));i.log("Fired ajax abort async = "+u+".")}},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(u.onReceived,[i])},processMessages:function(t,i,u){var f;if(r.markLastMessage(t),i){if(f=r.maximizePersistentResponse(i),f.Disconnect){t.log("Disconnect command received from server.");t.stop(!1,!1);return}r.updateGroups(t,f.GroupsToken);f.MessageId&&(t.messageId=f.MessageId);f.Messages&&(n.each(f.Messages,function(n,i){r.triggerReceived(t,i)}),r.tryInitialize(f,u))}},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,r.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){r.markLastMessage(t)},n(t).bind(u.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+" and a connection lost timeout of "+i.timeout+"."))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(u.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){f(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return r.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},ensureReconnectingState:function(t){return e(t,i.connectionState.connected,i.connectionState.reconnecting)===!0&&n(t).triggerHandler(u.onReconnecting),t.state===i.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(n){return(new Date).getTime()-n._.lastActiveAt>=n.reconnectWindow?(n.log("There has not been an active server connection for an extended period of time. Stopping connection."),n.stop(),!1):!0},reconnect:function(n,u){var f=i.transports[u];if(s(n)&&!n._.reconnectTimeout){if(!r.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){r.verifyLastActive(n)&&(f.stop(n),r.ensureReconnectingState(n)&&(n.log(u+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,r,f,e,o){t.state===i.connectionState.connecting?(t.log("Failed to parse server response while attempting to connect."),e()):(n(t).triggerHandler(u.onError,[i._.transportError(i._.format(i.resources.parseFailed,r),t.transport,f,o)]),t.stop())},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:!0,send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){if(this===e.socket){if(c)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketClosed,e.transport,t)]),e.log("Unclean disconnect from websocket: "+t.reason||"[no reason given].")):e.log("Websocket closed.");else{s?s():a&&l.reconnect(e);return}l.reconnect(e)}},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){"use strict";var i=n.signalR,u=n.signalR.events,f=n.signalR.changeState,r=i.transports._logic;i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:!0,timeOut:3e3,start:function(e,o,s){var h=this,c=!1,l=n(e),a=!o,v,y;if(e.eventSource&&(e.log("The connection already has an event source. Stopping it."),e.stop()),!t.EventSource){s&&(e.log("This browser doesn't support SSE."),s());return}v=r.getUrl(e,this.name,a);try{e.log("Attempting to connect to SSE endpoint '"+v+"'.");e.eventSource=new t.EventSource(v)}catch(p){e.log("EventSource failed trying to connect with error "+p.Message+".");s?s():(l.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,e.transport,p)]),a&&h.reconnect(e));return}a&&(y=t.setTimeout(function(){c===!1&&e.eventSource.readyState!==t.EventSource.OPEN&&h.reconnect(e)},h.timeOut));e.eventSource.addEventListener("open",function(){e.log("EventSource connected.");y&&t.clearTimeout(y);r.clearReconnectTimeout(e);c===!1&&(c=!0,f(e,i.connectionState.reconnecting,i.connectionState.connected)===!0&&l.triggerHandler(u.onReconnect))},!1);e.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=e._parseResponse(n.data)}catch(i){r.handleParseFailure(e,n.data,i,s,n);return}r.processMessages(e,t,o)}},!1);e.eventSource.addEventListener("error",function(n){if(this===e.eventSource){if(!c){s&&s();return}e.log("EventSource readyState: "+e.eventSource.readyState+".");n.eventPhase===t.EventSource.CLOSED?(e.log("EventSource reconnecting due to the server connection ending."),h.reconnect(e)):(e.log("EventSource error."),l.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceError,e.transport,n)]))}},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:!0,iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages, reconnecting.");l.reconnect(n)};if(t.EventSource){e&&(n.log("This browser supports SSE, skipping Forever Frame."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.body.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e;if(i.processMessages(t,u,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occured when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){"use strict";var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,r=i.transports._logic;i.transports.longPolling={name:"longPolling",supportsKeepAlive:!1,reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;o.log("LongPolling connected.");s();h=null},y=function(){return h?(h(),h=null,o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(r){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(r,i.connectionState.reconnecting,i.connectionState.connected)===!0&&(r.log("Raising the reconnect event"),n(r).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var d=s.messageId,g=d===null,b=!g,nt=!h,k=r.getUrl(s,a.name,b,nt);f(s)!==!0&&(o.log("Opening long polling request to '"+k+"'."),s.pollXhr=n.ajax(n.extend({},n.signalR.ajaxDefaults,{xhrFields:{withCredentials:o.withCredentials},url:k,type:"GET",dataType:o.ajaxDataType,contentType:o.contentType,success:function(i){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(i)}catch(b){r.handleParseFailure(s,i,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=r.maximizePersistentResponse(h)),r.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),u&&u.Disconnect)||f(s)!==!0&&(a=u&&u.ShouldReconnect,!a||r.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y()){if(l++,o.state!==i.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+". Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[i._.transportError(i.resources.longPollFailed,o.transport,f,s.pollXhr)])),(o.state===i.connectionState.connected||o.state===i.connectionState.reconnecting)&&!r.verifyLastActive(o))return;if(!r.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}})),b&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(){throw new Error("Lost Connection not handled for LongPolling");},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){"use strict";function r(n){return n+e}function s(n,t,i){for(var f=n.length,u=[],r=0;r=0&&(t&&typeof t.then=="function"&&typeof t.catch=="function"?t.then(function(t){f(n,t)}).catch(function(t){s(n,t)}):t&&t.continueWith?t.continueWith(function(t){f(n,t)}):i.invoke("sys.callback",!1,[n,t]))},s=function(n,t){i.invoke("sys.callbackException",!1,[n,t])},e,o,i;typeof Promise=="function"?(o=function(n){n.continueWith=function(t){var i=n.then(t);return o(i),i}},e=function(){var n={id:i.generateId()};return n.promise=new Promise(function(t,i){n.setResult=t;n.setException=i}),o(n.promise),n}):e=function(){var n={id:i.generateId(),callback:null,promise:{continueWith:function(t){if(typeof t=="function")if(n.callback){var i=n.callback;n.callback=function(n){return t(i(n))}}else n.callback=t;return n.promise}},setResult:function(n){this.callback!==null&&this.callback(n)},setException:function(){}};return n};i={extensions:[],inits:[],callbackTable:[],nextId:0,connection:null,isReconnecting:!1,isUnloading:!1,extractName:function(n){var t=n.lastIndexOf("."),i=null,r=null;return t>0&&(i=n.substr(0,t).toLowerCase(),r=n.substr(t+1)),{factoryName:i,methodName:r}},log:function(){typeof console!="undefined"&&(window.console.debug?window.console.debug.apply(null,arguments):window.console.log&&window.console.log.apply(null,arguments))},invoke:function(n,i,r){var u={},h,f,c,o,l,s,a;u.name=n;u.args=r;u.callbackId=-1;i&&(f=e(),c=f.promise,this.callbackTable[f.id]=f,u.callbackId=f.id);h=t.stringify(u);try{for(o=this.breakIntoSegments(h),l=o.length>1?this.generateId():0,s=0;s0;)i=t>u?u:t,f.push(n.substring(r,r+i)),r+=i,t-=i;return f},dispatchCallback:function(n,t,i){var r=this.extractName(n),e,u,o,c;if(r.factoryName&&r.methodName){if(r.factoryName==="sys"){if(r.methodName==="callback"){e=t[0];u=t[1];try{this.callbackTable[e].setResult(u)}catch(h){this.log("Failed to invoke return value callback:\n"+h.toString())}this.removeTask(e)}if(r.methodName==="callbackException"){e=t[0];u=t[1];try{this.callbackTable[e].setException(new Error(u).toString())}catch(h){this.log("Failed to invoke exception handler callback:\n"+h.toString())}this.removeTask(e)}return}if(o=this.extensions[r.factoryName],!o||!o[r.methodName]){this.log("Failed to match method call "+n);return}for(c=t.length;c<15;c++)t[c]=null;try{u=o[r.methodName](t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14])}catch(h){u=undefined;this.log("Exception thrown in callback method "+r.methodName+": %o",h);s(i,h.toString())}typeof u!="undefined"&&f(i,u)}},addExtensions:function(){try {{ var extension = (function(n){"use strict";return{log:function(t){n.log(t)}}});; this.addExtension("Microsoft.WebTools.BrowserLink.CoreExtensionFactory", extension); }} catch(e) {{ this.log("Invalid extension script encountered for extension 'Microsoft.WebTools.BrowserLink.CoreExtensionFactory'."); return; }} try {{ var extension = (function(n,t){"use strict";var f=[],i=[],h=function(n){for(var i,t=0;t=i.originalStart&&t<=i.originalStart+i.originalLength},o=function(n,t){return e(n,function(n){return n.type!=1?!1:y(n,t)})},it=function(n,t,i){return e(n,function(n){var u=r(n);return u&&typeof u.originalStart!="undefined"&&u.originalStart==t&&u.originalLength==i})},p=function(n){var t=s(n);return{index:t.length,source:n,collection:t}},w=function(n,t){var r=n.index-1,i;return r>=0&&(i=n.collection[r],i.type==4&&y(i,t))?(n=p(i),w(n,t)):n},rt=function(n,t){var i=e(n,function(n){var i=r(n);return i&&typeof i.originalStart!="undefined"&&t=0;r--)if(f=t.children[r],u=n(f,i),u)return u;return t.getDomNode()===i?{logicalNode:t}:t.getDomNode()?{foundOtherDomNode:!0}:null},u=function(t,r){for(var o,f,e=t.parent,s=e.children.indexOf(t),u=s-1;u>=0;u--)if(o=e.children[u],f=n(o,r),i,f)return f;return null},t=function(n,i){var r=u(n,i);return r?r:n.parent?n.parent.getDomNode()===i?{logicalNode:n.parent}:n.parent.getDomNode()?{foundOtherDomNode:!0}:t(n.parent,i):null},r=function(n){return o.innerHTML=n,o.innerHTML},f=function(n){for(var f,t=n.__browserLink_LogicalNodes.slice(),u="",i=0;i1&&u==n.textContent?!0:!1},e=function(n){for(var f,e,t=n.__browserLink_LogicalNodes.slice(),i=n,u=0;u0&&(t=n.indexOf(this),t>=0&&n.splice(t,1))};this.setupRelatedDomNode=function(){var n,i;this.domNode.__browserLink_LogicalNodes?(n=t(this,this.domNode),n&&n.logicalNode?(i=this.domNode.__browserLink_LogicalNodes.indexOf(n.logicalNode),this.domNode.__browserLink_LogicalNodes.splice(i+1,0,this)):this.domNode.__browserLink_LogicalNodes.splice(0,0,this),this.domNode.nodeType===Node.TEXT_NODE&&f(this.domNode)&&e(this.domNode)):this.domNode.__browserLink_LogicalNodes=[this]};this.setDomNode=function(n){this.domNode!==n&&(this.domNode&&this.disconnectRelatedDomNode(),this.domNode=n,this.domNode&&this.setupRelatedDomNode())}}function ht(){var f,e;this.root={};var u="\0",s=1,h={},k=this;this.createNewLogicalNode=function(n,t,i,r){var u=new d,f,e;return n&&(u.type=n),t&&u.setDomNode(t),i&&(u.parent=i,n===st.Attribute?i.attributes.push(u):(f=r?i.children.indexOf(r):-1,f>=0?(e=f+1,i.children.splice(e,0,u)):i.children.splice(0,0,u))),u};var c=function(n){var r=t.extend(new d,n),i,u,f;if(n.children)for(i=0;i0&&(r=h[i],n.setDomNode(r)),n.children)for(t=0;t=i?e>=o?(u=i,f=0,s=0):e>u?(u=i,f=o-e,s=e>=h?0:h-e):u+=r:h>i?(e>h?s=i-u:s+=r,e>o?f=i-u:f+=r):o>i&&(e>o?f=i-u:f+=r);n.start.position=u;n.length=f;n.startTagLength&&(n.startTagLength=s);w(n,t,i,r)}};this.buildDocumentBlockList=function(){var t=[];y(document,t);n.invoke("UpdateBlockListFromDOM",n.initializationData.requestId,t)};this.initialize=function(t){o==null&&(o=document.createElement("textarea"));this.root=c(t.root);v(this.root);g();a=!0;n.sourceMapping.ensureUpToDateAsync(null)};this.applyChangesInFile=function(n,t){while(t.length>=2){var i=t.shift(),r=t.shift();b(this.root,n,i,r)}};this.getLogicalNodesFromDomNode=function(n){return n&&n.__browserLink_LogicalNodes?n.__browserLink_LogicalNodes:[]};this.getFirstLogicalNodeFromDomNode=function(n){var t=this.getLogicalNodesFromDomNode(n);return t&&t.length>0?t[0]:null};this.getAllNodesStartingAtPosition=function(n,t){var i=[];return f(n,t,this.root,i),i};f=function(n,t,i,r){var e,u,o;if(i){if(i.start&&t===i.start.position&&n===i.start.path&&r.push(i),i.children)for(u=0;u=i.start.position&&t=f.length)&&(r=f);if(i.attributes)for(u=0;u=f.length)&&(r=f);return r}}function ct(){var s=this,v=function(n){return w(n)},p=function(n,t,r){if(n0)return i.Task;for(u=c,c=[],t=0;t0?t.Task:f.length==0?t.Task:(ot(function(){var t=f,n;for(f=[],n=0;n=t-u.start)return i.cssRules[r];break}return null};this.getAllSourcePaths=function(){return i};this.internal={addMappingRangeForObject:function(n,t){var r=e(t.sourcePath||t.sourceUrl),i={sourceIndex:r,start:t.startPosition,length:t.length};b(n,i);u.push(i)}};o=5e3;l=[];this.validateStyleSheet=function(t){var r=l.indexOf(t.href)>=0,i;return r?!1:(i=function(n){var r=0,u,f;try{if(n&&n.cssRules&&(r+=t.cssRules.length,r>o))return r;for(u=0;uo))break;return r}catch(e){return o+1}},i(t)>o)?(l.push(t.href),n.log(`CSS Hot Reload ignoring ${t.href} because it was inaccessible or had more than ${o} rules.`),!1):!0}}var i=[],s={},h=!1,a=!1,r=0,f=[],c=[],u=[],v={},y=function(){var n=[];this.complete=function(){for(var t=null;n.length;)t=n.shift()(t)};this.Task={continueWith:function(t){n.push(t)}}},rt=function(n){return n.selectorText||n.media},p=function(n){var r=rt(n),t,i,u;if(!r)return{value:null};for(t=v[r],t||(t=[],v[r]=t),i=0;i=t?f>=o?(r=t,u=0,e=0):f>r?(u=o-f,r=t,e=f>=s?0:s-f):r+=i:s>t?(f>s?e=t-r:e+=i,f>o?u=t-r:u+=i):o>t&&(f>o?u=t-r:u+=i);n.start=r;n.length=u;n.startTag&&(n.startTag=e)},et=function(n,t){for(var f,e,i,r;t.length>=2;)for(f=t.shift(),e=t.shift(),i=0;i=2?s[1]:{},i={selectorData:r,sourceIndex:f[0]+t,start:f[1],length:f[2],isLiteral:f[3],startTag:f.length>=5?f[4]:null,children:g(l.children,t),ancestors:g(l.ancestors,t)},l.templateLike&&o.length==2&&(r.isTemplateLike=!0,r.isInTemplateLike=!0),e=0;e0))for(i=document.styleSheets,t=0;t=0?(et(r,t),!0):!1},applyChangesInFileToLogicalTree:function(t,i){n.logicalTree.applyChangesInFile(t,i)},onConnected:function(){Array.prototype.indexOf&&(n.logicalTree.buildDocumentBlockList(),n.sourceMapping.ensureUpToDateAsync(null))},setLogicalTree:function(t,r){i=i.concat(r);n.logicalTree.initialize(t)}}});; this.addExtension("Microsoft.WebTools.BrowserLink.SourceMappingExtensionFactory", extension); }} catch(e) {{ this.log("Invalid extension script encountered for extension 'Microsoft.WebTools.BrowserLink.SourceMappingExtensionFactory'."); return; }} try {{ var extension = (function(){"use strict";return{refresh:function(){location.reload(!0)},navigate:function(n){location.href=n}}});; this.addExtension("Microsoft.WebTools.BrowserLink.Package.RefreshExtensionFactory", extension); }} catch(e) {{ this.log("Invalid extension script encountered for extension 'Microsoft.WebTools.BrowserLink.Package.RefreshExtensionFactory'."); return; }} try {{ var extension = /*! For license information please see tools_bundle.js.LICENSE.txt */ function(){var e={399:function(e,t,i){"use strict";i.d(t,{default:function(){return Iv}});var o={};i.r(o);var n=i(993);function r(e){return new s(e)}class s{constructor(e){if(this.node=e,!e)throw Error("node must not be null or undefined.")}get isUnsupported(){return this.node.properties&&this.node.properties[s.isUnsupportedPropertyName]}set isUnsupported(e){this.verifyPropertyBagExists(),this.node.properties[s.isUnsupportedPropertyName]=e}get mapsToDom(){var e;return!1!==(null===(e=this.node.properties)||void 0===e?void 0:e[s.mapsToDomPropertyName])}set mapsToDom(e){this.verifyPropertyBagExists(),this.node.properties[s.mapsToDomPropertyName]=e}get codeBlockType(){var e;return this.convertToCodeBlockType(null===(e=this.node.properties)||void 0===e?void 0:e[s.codeBlockTypePropertyName])}set codeBlockType(e){this.verifyPropertyBagExists();const t=this.convertStringToCodeBlockType(e);this.node.properties[s.codeBlockTypePropertyName]=t}convertToCodeBlockType(e){return 1===e?"SelfContained":2===e?"Conditional":3===e?"Loop":4===e?"Block":"None"}convertStringToCodeBlockType(e){return"SelfContained"===e?1:"Conditional"===e?2:"Loop"===e?3:"Block"===e?4:0}verifyPropertyBagExists(){this.node.properties||(this.node.properties={})}}function a(e){return void 0!==e.getBoundingClientRect}function l(e){let t=1/0,i=1/0,o=-1/0,n=-1/0;for(const r of e)r&&r.left!==1/0&&r.top!==1/0&&r.right!==-1/0&&r.bottom!==-1/0&&(t=r.lefto?r.right:o,n=r.bottom>n?r.bottom:n);return function(e,t,i,o){return e!==1/0&&t!==1/0&&i!==-1/0&&o!==-1/0}(t,i,o,n)?DOMRect.fromRect({x:t,y:i,width:o-t,height:n-i}):null}s.isUnsupportedPropertyName="IsUnsupportedProperty",s.mapsToDomPropertyName="MapsToDomProperty",s.codeBlockTypePropertyName="CodeBlockTypeProperty";class c{constructor(){this.isMouseCloserToBoundingClientRectLeftThanRight=(e,t)=>e<(2*t.left+t.width)/2}getBoundingClientRect(e){if(a(e))return e.getBoundingClientRect();const t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect()}hasNonZeroArea(e){const t=this.getBoundingClientRect(e);return t&&t.width>0&&t.height>0}getBoundingRectForLogicalNode(e){const t=e.getDomNode();if(t)return this.getBoundingClientRect(t);return function(...e){const t=e.map((e=>{if(!e)return null;if(e.nodeType==Node.TEXT_NODE){const t=e;if(t.parentNode){const e=document.createRange();return e.selectNode(t),l(e.getClientRects())}return null}return e.nodeType==Node.ELEMENT_NODE?e.getBoundingClientRect():void 0}));return l(t)}(...this.getClosestAncestorDomNodes(e))}areCoordinatesInsideLogicalNode(e,t,i){const o=this.getBoundingRectForLogicalNode(i);return this.areCoordinatesInsideBoundingClientRect(e,t,o)}areCoordinatesInsideBoundingClientRect(e,t,i){const o=e>=i.left&&e<=i.right,n=t>=i.top&&t<=i.bottom;return o&&n}getClosestAncestorDomNodes(e){const t=[];if(!e)return t;const i=e.getDomNode();return i?(t.push(i),t):e.children?e.children.map((e=>this.getClosestAncestorDomNodes(e))).flat():t}}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function u(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};p(this,e),this.init(t,i)}return f(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||x,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i1?t-1:0),o=1;o-1?e.replace(/###/g,"."):e}function n(){return!e||"string"==typeof e}for(var r="string"!=typeof t?[].concat(t):t.split(".");r.length>1;){if(n())return{};var s=o(r.shift());!e[s]&&i&&(e[s]=new i),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return n()?{}:{obj:e,k:o(r.shift())}}function T(e,t,i){var o=L(e,t,Object);o.obj[o.k]=i}function O(e,t){var i=L(e,t),o=i.obj,n=i.k;if(o)return o[n]}function _(e,t,i){var o=O(e,i);return void 0!==o?o:O(t,i)}function I(e,t,i){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?i&&(e[o]=t[o]):I(e[o],t[o],i):e[o]=t[o]);return e}function D(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var R={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return R[e]})):e}var A="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,F=function(e){function t(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return p(this,t),i=b(this,m(t).call(this)),A&&C.call(v(i)),i.data=e||{},i.options=o,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i}return w(t,e),f(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,r=[e,t];return i&&"string"!=typeof i&&(r=r.concat(i)),i&&"string"==typeof i&&(r=r.concat(n?i.split(n):i)),e.indexOf(".")>-1&&(r=e.split(".")),O(this.data,r)}},{key:"addResource",value:function(e,t,i,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0===r&&(r=".");var s=[e,t];i&&(s=s.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(o=t,t=(s=e.split("."))[1]),this.addNamespaces(t),T(this.data,s,o),n.silent||this.emit("added",e,t,i,o)}},{key:"addResources",value:function(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var n in i)"string"!=typeof i[n]&&"[object Array]"!==Object.prototype.toString.apply(i[n])||this.addResource(e,t,n,i[n],{silent:!0});o.silent||this.emit("added",e,t,i)}},{key:"addResourceBundle",value:function(e,t,i,o,n){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(o=i,i=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=O(this.data,s)||{};o?I(a,i,n):a=u({},a,i),T(this.data,s,a),r.silent||this.emit("added",e,t,i)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?u({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(C),B={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,o,n){var r=this;return e.forEach((function(e){r.processors[e]&&(t=r.processors[e].process(t,i,o,n))})),t}},M={},V=function(e){function t(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p(this,t),i=b(this,m(t).call(this)),A&&C.call(v(i)),E(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,v(i)),i.options=o,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i.logger=S.create("translator"),i}return w(t,e),f(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=this.resolve(e,t);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(e,t){var i=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,n=t.ns||this.options.defaultNS;if(i&&e.indexOf(i)>-1){var r=e.match(this.interpolator.nestingRegexp);if(r&&r.length>0)return{key:e,namespaces:n};var s=e.split(i);(i!==o||i===o&&this.options.ns.indexOf(s[0])>-1)&&(n=s.shift()),e=s.join(o)}return"string"==typeof n&&(n=[n]),{key:e,namespaces:n}}},{key:"translate",value:function(e,i,o){var n=this;if("object"!==d(i)&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],i),a=s.key,l=s.namespaces,c=l[l.length-1],h=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(p){var g=i.nsSeparator||this.options.nsSeparator;return c+g+a}return a}var f=this.resolve(e,i),v=f&&f.res,b=f&&f.usedKey||a,m=f&&f.exactUsedKey||a,y=Object.prototype.toString.apply(v),w=["[object Number]","[object Function]","[object RegExp]"],x=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v;if(k&&v&&S&&w.indexOf(y)<0&&("string"!=typeof x||"[object Array]"!==y)){if(!i.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,v,i):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");if(r){var C="[object Array]"===y,$=C?[]:{},N=C?m:b;for(var E in v)if(Object.prototype.hasOwnProperty.call(v,E)){var L="".concat(N).concat(r).concat(E);$[E]=this.translate(L,u({},i,{joinArrays:!1,ns:l})),$[E]===L&&($[E]=v[E])}v=$}}else if(k&&"string"==typeof x&&"[object Array]"===y)(v=v.join(x))&&(v=this.extendTranslation(v,e,i,o));else{var T=!1,O=!1,_=void 0!==i.count&&"string"!=typeof i.count,I=t.hasDefaultValue(i),D=_?this.pluralResolver.getSuffix(h,i.count):"",R=i["defaultValue".concat(D)]||i.defaultValue;!this.isValidLookup(v)&&I&&(T=!0,v=R),this.isValidLookup(v)||(O=!0,v=a);var P=I&&R!==v&&this.options.updateMissing;if(O||T||P){if(this.logger.log(P?"updateKey":"missingKey",h,c,a,P?R:v),r){var A=this.resolve(a,u({},i,{keySeparator:!1}));A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var M=0;M1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;i=c;var d=l.namespaces;s.options.fallbackNS&&(d=d.concat(s.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,u=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,p=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);d.forEach((function(e){s.isValidLookup(t)||(r=e,!M["".concat(p[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(r)&&(M["".concat(p[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(i){if(!s.isValidLookup(t)){n=i;var r,l,d=c,p=[d];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(p,c,i,e,a);else h&&(r=s.pluralResolver.getSuffix(i,a.count)),h&&u&&p.push(d+r),u&&p.push(d+="".concat(s.options.contextSeparator).concat(a.context)),h&&p.push(d+=r);for(;l=p.pop();)s.isValidLookup(t)||(o=l,t=s.getResource(i,e,l,a))}})))}))}})),{res:t,usedKey:i,exactUsedKey:o,usedLng:n,usedNS:r}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,o):this.resourceStore.getResource(e,t,i,o)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&void 0!==e[i])return!0;return!1}}]),t}(C);function j(e){return e.charAt(0).toUpperCase()+e.slice(1)}var z=function(){function e(t){p(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=S.create("languageUtils")}return f(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map((function(e){return e.toLowerCase()})):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=j(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=j(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=j(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,i=this;return e?(e.forEach((function(e){if(!t){var o=i.formatLanguageCode(e);i.options.supportedLngs&&!i.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=i.getLanguagePartFromCode(e);if(i.isSupportedCode(o))return t=o;t=i.options.supportedLngs.find((function(e){if(0===e.indexOf(o))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e["default"]||[];var i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e["default"]),i||[]}},{key:"toResolveHierarchy",value:function(e,t){var i=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],r=function(e){e&&(i.isSupportedCode(e)?n.push(e):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),o.forEach((function(e){n.indexOf(e)<0&&r(i.formatLanguageCode(e))})),n}}]),e}(),H=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],U={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function q(){var e={};return H.forEach((function(t){t.lngs.forEach((function(i){e[i]={numbers:t.nr,plurals:U[t.fc]}}))})),e}var K=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,e),this.languageUtils=t,this.options=i,this.logger=S.create("pluralResolver"),this.rules=q()}return f(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,i=this.getRule(e);return i?i.numbers.map((function(i){return t.getSuffix(e,i)})):[]}},{key:"getSuffix",value:function(e,t){var i=this,o=this.getRule(e);if(o){var n=o.noAbs?o.plurals(t):o.plurals(Math.abs(t)),r=o.numbers[n];this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var s=function(){return i.options.prepend&&r.toString()?i.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]?s():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),W=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(this,e),this.logger=S.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return f(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:P,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?D(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?D(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?D(t.nestingPrefix):t.nestingPrefixEscaped||D("$t("),this.nestingSuffix=t.nestingSuffix?D(t.nestingSuffix):t.nestingSuffixEscaped||D(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(e,t,i,o){var n,r,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var d=function(e){if(e.indexOf(a.formatSeparator)<0){var n=_(t,l,e);return a.alwaysFormat?a.format(n,void 0,i):n}var r=e.split(a.formatSeparator),s=r.shift().trim(),c=r.join(a.formatSeparator).trim();return a.format(_(t,l,s),c,i,o)};this.resetRegExp();var h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,u=o&&o.interpolation&&o.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;n=t.regex.exec(e);){if(void 0===(r=d(n[1].trim())))if("function"==typeof h){var i=h(e,n,o);r="string"==typeof i?i:""}else{if(u){r=n[0];continue}a.logger.warn("missed to pass in variable ".concat(n[1]," for interpolating ").concat(e)),r=""}else"string"==typeof r||a.useRawValueToEscape||(r=N(r));if(e=e.replace(n[0],t.safeValue(r)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var i,o,n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=u({},r);function a(e,t){var i=this.nestingOptionsSeparator;if(e.indexOf(i)<0)return e;var o=e.split(new RegExp("".concat(i,"[ ]*{"))),n="{".concat(o[1]);e=o[0],n=(n=this.interpolate(n,s)).replace(/'/g,'"');try{s=JSON.parse(n),t&&(s=u({},t,s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(i).concat(n)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;i=this.nestingRegexp.exec(e);){var l=[],c=!1;if(i[0].includes(this.formatSeparator)&&!/{.*}/.test(i[1])){var d=i[1].split(this.formatSeparator).map((function(e){return e.trim()}));i[1]=d.shift(),l=d,c=!0}if((o=t(a.call(this,i[1].trim(),s),s))&&i[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=N(o)),o||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(e)),o=""),c&&(o=l.reduce((function(e,t){return n.format(e,t,r.lng,r)}),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}]),e}();var G=function(e){function t(e,i,o){var n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p(this,t),n=b(this,m(t).call(this)),A&&C.call(v(n)),n.backend=e,n.store=i,n.services=o,n.languageUtils=o.languageUtils,n.options=r,n.logger=S.create("backendConnector"),n.state={},n.queue=[],n.backend&&n.backend.init&&n.backend.init(o,r.backend,r),n}return w(t,e),f(t,[{key:"queueLoad",value:function(e,t,i,o){var n=this,r=[],s=[],a=[],l=[];return e.forEach((function(e){var o=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!i.reload&&n.store.hasResourceBundle(e,t)?n.state[a]=2:n.state[a]<0||(1===n.state[a]?s.indexOf(a)<0&&s.push(a):(n.state[a]=1,o=!1,s.indexOf(a)<0&&s.push(a),r.indexOf(a)<0&&r.push(a),l.indexOf(t)<0&&l.push(t)))})),o||a.push(e)})),(r.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:o}),{toLoad:r,pending:s,toLoadLanguages:a,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,i){var o=e.split("|"),n=o[0],r=o[1];t&&this.emit("failedLoading",n,r,t),i&&this.store.addResourceBundle(n,r,i),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(i){!function(e,t,i,o){var n=L(e,t,Object),r=n.obj,s=n.k;r[s]=r[s]||[],o&&(r[s]=r[s].concat(i)),o||r[s].push(i)}(i.loaded,[n],r),function(e,t){for(var i=e.indexOf(t);-1!==i;)e.splice(i,1),i=e.indexOf(t)}(i.pending,e),t&&i.errors.push(t),0!==i.pending.length||i.done||(Object.keys(i.loaded).forEach((function(e){s[e]||(s[e]=[]),i.loaded[e].length&&i.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,i){var o=this,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[i](e,t,(function(a,l){a&&l&&n<5?setTimeout((function(){o.read.call(o,e,t,i,n+1,2*r,s)}),r):s(a,l)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var r=this.queueLoad(e,t,o,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach((function(e){i.loadOne(e)}))}},{key:"load",value:function(e,t,i){this.prepareLoading(e,t,{},i)}},{key:"reload",value:function(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}},{key:"loadOne",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),n=o[0],r=o[1];this.read(n,r,"read",void 0,void 0,(function(o,s){o&&t.logger.warn("".concat(i,"loading namespace ").concat(r," for language ").concat(n," failed"),o),!o&&s&&t.logger.log("".concat(i,"loaded namespace ").concat(r," for language ").concat(n),s),t.loaded(e,o,s)}))}},{key:"saveMissing",value:function(e,t,i,o,n){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=i&&""!==i&&(this.backend&&this.backend.create&&this.backend.create(e,t,i,o,null,u({},r,{isUpdate:n})),e&&e[0]&&this.store.addResource(e[0],t,i,o))}}]),t}(C);function X(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===d(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===d(e[2])||"object"===d(e[3])){var i=e[3]||e[2];Object.keys(i).forEach((function(e){t[e]=i[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,i,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function Y(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Q(){}var Z=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(p(this,t),e=b(this,m(t).call(this)),A&&C.call(v(e)),e.options=Y(i),e.services={},e.logger=S,e.modules={external:[]},o&&!e.isInitialized&&!i.isClone){if(!e.options.initImmediate)return e.init(i,o),b(e,v(e));setTimeout((function(){e.init(i,o)}),0)}return e}return w(t,e),f(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function o(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(i=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=u({},X(),this.options,Y(t)),this.format=this.options.interpolation.format,i||(i=Q),!this.options.isClone){this.modules.logger?S.init(o(this.modules.logger),this.options):S.init(null,this.options);var n=new z(this.options);this.store=new F(this.options.resources,this.options);var r=this.services;r.logger=S,r.resourceStore=this.store,r.languageUtils=n,r.pluralResolver=new K(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),r.interpolator=new W(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new G(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(function(t){for(var i=arguments.length,o=new Array(i>1?i-1:0),n=1;n1?i-1:0),n=1;n0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var a=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];a.forEach((function(t){e[t]=function(){var i;return(i=e.store)[t].apply(i,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(t){e[t]=function(){var i;return(i=e.store)[t].apply(i,arguments),e}}));var c=$(),d=function(){var t=function(t,o){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(o),i(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}},{key:"loadResources",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q,o=i,n="string"==typeof e?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase())return o();var r=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};if(n)s(n);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(r,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,t,i){var o=$();return e||(e=this.languages),t||(t=this.options.ns),i||(i=Q),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),i(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&B.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var i=this;this.isLanguageChangingTo=e;var o=$();this.emit("languageChanging",e);var n=function(e){var n="string"==typeof e?e:i.services.languageUtils.getBestMatchFromCodes(e);n&&(i.language||(i.language=n,i.languages=i.services.languageUtils.toResolveHierarchy(n)),i.translator.language||i.translator.changeLanguage(n),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(n)),i.loadResources(n,(function(e){!function(e,n){n?(i.language=n,i.languages=i.services.languageUtils.toResolveHierarchy(n),i.translator.changeLanguage(n),i.isLanguageChangingTo=void 0,i.emit("languageChanged",n),i.logger.log("languageChanged",n)):i.isLanguageChangingTo=void 0,o.resolve((function(){return i.t.apply(i,arguments)})),t&&t(e,(function(){return i.t.apply(i,arguments)}))}(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(n):n(e):n(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t){var i=this,o=function e(t,o){var n;if("object"!==d(o)){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],n=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var s=function(e,i){var o=t.services.backendConnector.state["".concat(e,"|").concat(i)];return-1===o||2===o};if(i.precheck){var a=i.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(o,e)||(!this.services.backendConnector.backend||!(!s(o,e)||n&&!s(r,e)))}},{key:"loadNamespaces",value:function(e,t){var i=this,o=$();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){i.options.ns.indexOf(e)<0&&i.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var i=$();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],n=e.filter((function(e){return o.indexOf(e)<0}));return n.length?(this.options.preload=o.concat(n),this.loadResources((function(e){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new t(e,i)}},{key:"cloneInstance",value:function(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q,n=u({},this.options,i,{isClone:!0}),r=new t(n),s=["store","services","language"];return s.forEach((function(t){r[t]=e[t]})),r.services=u({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r.translator=new V(r.services,r.options),r.translator.on("*",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o0){var r=o.maxAge-0;if(isNaN(r))throw new Error("maxAge should be a Number");n+="; Max-Age="+Math.floor(r)}if(o.domain){if(!ne.test(o.domain))throw new TypeError("option domain is invalid");n+="; Domain="+o.domain}if(o.path){if(!ne.test(o.path))throw new TypeError("option path is invalid");n+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");n+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(n+="; HttpOnly"),o.secure&&(n+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n},se=function(e,t,i,o){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};i&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+60*i*1e3)),o&&(n.domain=o),document.cookie=re(e,encodeURIComponent(t),n)},ae=function(e){for(var t=e+"=",i=document.cookie.split(";"),o=0;o-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=i.substring(1).split("&"),n=0;n0)o[n].substring(0,r)===e.lookupQuerystring&&(t=o[n].substring(r+1))}}return t}},de=null,he=function(){if(null!==de)return de;try{de="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){de=!1}return de},ue={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&he()){var i=window.localStorage.getItem(e.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&he()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},pe=null,ge=function(){if(null!==pe)return pe;try{pe="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){pe=!1}return pe},fe={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&ge()){var i=window.sessionStorage.getItem(e.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&ge()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},ve={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var i=0;i0?t:void 0}},be={name:"htmlTag",lookup:function(e){var t,i=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return i&&"function"==typeof i.getAttribute&&(t=i.getAttribute("lang")),t}},me={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof i[e.lookupFromPathIndex])return;t=i[e.lookupFromPathIndex].replace("/","")}else t=i[0].replace("/","")}return t}},ye={name:"subdomain",lookup:function(e){var t;if("undefined"!=typeof window){var i=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);i instanceof Array&&(t="number"==typeof e.lookupFromSubdomainIndex?i[e.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):i[0].replace("http://","").replace("https://","").replace(".",""))}return t}};var we=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,e),this.type="languageDetector",this.detectors={},this.init(t,i)}return f(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=oe(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(le),this.addDetector(ce),this.addDetector(ue),this.addDetector(fe),this.addDetector(ve),this.addDetector(be),this.addDetector(me),this.addDetector(ye)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var i=[];return e.forEach((function(e){if(t.detectors[e]){var o=t.detectors[e].lookup(t.options);o&&"string"==typeof o&&(o=[o]),o&&(i=i.concat(o))}})),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var i=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){i.detectors[t]&&i.detectors[t].cacheUserLanguage(e,i.options)})))}}]),e}();we.type="languageDetector";var xe=JSON.parse('{"translation":{"buttons":{"cancel":"Cancel","confirm":"Confirm"},"closeDialog":{"choice_pageSession":"On the next page load","choice_permanent":"Never","choice_visualStudioSession":"The next time I open Visual Studio","details":"When would you like to see Web Live Preview again?","header":"Confirm close?"},"menu":{"close":"Close","disableInspector":"Disable Inspector","enableInspector":"Enable Inspector","showEmptyElements":"Show Empty Elements","ariaLabel":"Web Live Preview"},"status":{"connectingToVisualStudio":"Connecting to Visual Studio...","generatingLogicalTree":"Generating Logical Tree...","updating":"Updating...","upToDate":"Up To Date","disconnectedShortMessage":"Disconnected","disconnectedFullMessage":"The browser has been disconnected from Visual Studio. Please refresh the browser to reconnect.","connectionTimeOut":"Connection timed out."},"simpleTextEditing":{"editableText_ariaLabel":"Text Editing Mode. Press ESC to escape."},"nodes":{"code":"Code","root":"Root"},"tagNavigator":{"leftScroller_ariaLabel":"Left Scroller","rightScroller_ariaLabel":"Right Scroller"},"selectorDecorator":{"elementOutline_ariaLabel":"Selected Element","actionPanel_ariaLabel":"Action Panel Indicator"},"menuButton":{"image_ariaLabel":"Web Live Preview Menu"},"logicalNodeShortNames":{"genericContainer":"Generic Container","root":"Root","unknown":"Unknown"},"actionPanel":{"title":"{{nodeName}} Tasks","_title.comment":"nodeName is the ID or tag name of the node for which the action panel is being displayed.","readOnlyProperty":"This property is read-only"},"screenReader":{"inspectorEnabled":"Inspector enabled.","inspectorDisabled":"Inspector disabled."}}}');var ke=function(){this.__data__=[],this.size=0};var Se=function(e,t){return e===t||e!=e&&t!=t};var Ce=function(e,t){for(var i=e.length;i--;)if(Se(e[i][0],t))return i;return-1},$e=Array.prototype.splice;var Ne=function(e){var t=this.__data__,i=Ce(t,e);return!(i<0)&&(i==t.length-1?t.pop():$e.call(t,i,1),--this.size,!0)};var Ee=function(e){var t=this.__data__,i=Ce(t,e);return i<0?void 0:t[i][1]};var Le=function(e){return Ce(this.__data__,e)>-1};var Te=function(e,t){var i=this.__data__,o=Ce(i,e);return o<0?(++this.size,i.push([e,t])):i[o][1]=t,this};function Oe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=gi},vi={};vi["[object Float32Array]"]=vi["[object Float64Array]"]=vi["[object Int8Array]"]=vi["[object Int16Array]"]=vi["[object Int32Array]"]=vi["[object Uint8Array]"]=vi["[object Uint8ClampedArray]"]=vi["[object Uint16Array]"]=vi["[object Uint32Array]"]=!0,vi["[object Arguments]"]=vi["[object Array]"]=vi["[object ArrayBuffer]"]=vi["[object Boolean]"]=vi["[object DataView]"]=vi["[object Date]"]=vi["[object Error]"]=vi["[object Function]"]=vi["[object Map]"]=vi["[object Number]"]=vi["[object Object]"]=vi["[object RegExp]"]=vi["[object Set]"]=vi["[object String]"]=vi["[object WeakMap]"]=!1;var bi=function(e){return Qt(e)&&fi(e.length)&&!!vi[Ye(e)]};var mi=function(e){return function(t){return e(t)}},yi="object"==typeof exports&&exports&&!exports.nodeType&&exports,wi=yi&&"object"==typeof module&&module&&!module.nodeType&&module,xi=wi&&wi.exports===yi&&Ae.process,ki=function(){try{var e=wi&&wi.require&&wi.require("util").types;return e||xi&&xi.binding&&xi.binding("util")}catch(e){}}(),Si=ki&&ki.isTypedArray,Ci=Si?mi(Si):bi,$i=Object.prototype.hasOwnProperty;var Ni=function(e,t){var i=ri(e),o=!i&&ni(e),n=!i&&!o&&di(e),r=!i&&!o&&!n&&Ci(e),s=i||o||n||r,a=s?Yt(e.length,String):[],l=a.length;for(var c in e)!t&&!$i.call(e,c)||s&&("length"==c||n&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||pi(c,l))||a.push(c);return a},Ei=Object.prototype;var Li=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ei)};var Ti=function(e,t){return function(i){return e(t(i))}},Oi=Ti(Object.keys,Object),_i=Object.prototype.hasOwnProperty;var Ii=function(e){if(!Li(e))return Oi(e);var t=[];for(var i in Object(e))_i.call(e,i)&&"constructor"!=i&&t.push(i);return t};var Di=function(e){return null!=e&&fi(e.length)&&!ot(e)};var Ri=function(e){return Di(e)?Ni(e):Ii(e)};var Pi=function(e,t){return e&&Xt(t,Ri(t),e)};var Ai=function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t},Fi=Object.prototype.hasOwnProperty;var Bi=function(e){if(!Qe(e))return Ai(e);var t=Li(e),i=[];for(var o in e)("constructor"!=o||!t&&Fi.call(e,o))&&i.push(o);return i};var Mi=function(e){return Di(e)?Ni(e,!0):Bi(e)};var Vi=function(e,t){return e&&Xt(t,Mi(t),e)},ji="object"==typeof exports&&exports&&!exports.nodeType&&exports,zi=ji&&"object"==typeof module&&module&&!module.nodeType&&module,Hi=zi&&zi.exports===ji?Be.Buffer:void 0,Ui=Hi?Hi.allocUnsafe:void 0;var qi=function(e,t){if(t)return e.slice();var i=e.length,o=Ui?Ui(i):new e.constructor(i);return e.copy(o),o};var Ki=function(e,t){var i=-1,o=e.length;for(t||(t=Array(o));++i{const o=i[0],n=i[1];"string"==typeof n||n instanceof String?t[o]=n.split("").reverse().join(""):e(n)}))}(Cn);const $n={en:xe,dev:Cn};function Nn(e,t){return J.t(e,t)}function En(e){const t={truncatedText:"",fullText:""};if(!e)return t;if(r(e).mapsToDom){const t=e.getDomNode();if(t)return function(e){const t={truncatedText:"",fullText:""};if(null==e||!e.nodeName)return t;if(t.fullText=e.nodeName.toLowerCase(),t.truncatedText=e.nodeName.toLowerCase(),e.nodeType===Node.ELEMENT_NODE){const i=e;t.fullText+=i.id&&i.id.length>0?"#"+i.id:"",t.fullText+=i.className&&i.className.length>0?"."+i.className.split(" ").join("."):"","html"!==t.truncatedText&&(t.truncatedText+=Ln(i.id,"#"),t.truncatedText+=Ln(i.className&&i.className.split(" ").join("."),"."))}return t}(t)}if("Element"===e.type?t.fullText=e.tagName.toLowerCase():"Attribute"===e.type?t.fullText=e.name.toLowerCase():"GenericContainer"===e.type?t.fullText=e.description:"CodeBlock"===e.type?t.fullText=`${Nn("nodes.code")}: ${r(e).codeBlockType}`:"Root"===e.type&&(t.fullText=Nn("nodes.root")),t.truncatedText=t.fullText,e.attributes)for(const o of e.attributes){var i;if("ID"===(null===(i=o.name)||void 0===i?void 0:i.toUpperCase())&&o.value&&o.value.length>0){t.fullText+="#"+o.value,t.truncatedText+=Ln(o.value,"#");break}}return t}function Ln(e,t){return e&&e.length>0?t+(e.length>30?e.substr(0,29)+"…":e):""}function Tn(e){const t=e.getDomNode();if(t)return[t];let i=[];for(let t=0;t=0;n--){const i=e.children[n];if(r(i).mapsToDom&&!t.includes(i))return i;const o=this.findRightMostDefaultDescendant(i,t);if(o)return o}return null}findLeftMostSelectableLeafInternal(e,t){if(t=t||this.isBodyTag(e),e.children)for(const i of e.children){const e=this.findLeftMostSelectableLeafInternal(i,t);if(e)return e}return t&&this.isInitiallySelectable(e)?e:null}isBodyTag(e){var t;return(null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase())===this.requiredAncestorForSelectability}isInitiallySelectable(e){return!(this._browserLink&&!Pn(this._browserLink,e))&&(_n(e)&&0===e.children.length&&e.getDomNode()&&this.nodeBoundingClientRectUtil.hasNonZeroArea(e.getDomNode()))}}class jn{constructor(e=null,t=null){this.modifiedParentNode=e,this.modifiedInsertAfterLogicalNode=t}}class zn{constructor(){this.parentNodeList=[]}get modifiedParentNode(){return 0===this.parentNodeList.length?null:this.parentNodeList[this.parentNodeList.length-1]}push(e){this.parentNodeList.push(e)}}function Hn(e,t){return 0===(null==e?void 0:e.localeCompare(t,void 0,{sensitivity:"accent"}))}class Un{constructor(e){var t;this._selectionChanged=new n.pB,this._nodeBoundingClientRectUtil=new c,this._browserLink=e,null!==(t=this._browserLink)&&void 0!==t&&t.selectionHostingService&&(this._selectionHostingService=this._browserLink.selectionHostingService,this._selectionHostingService.editorSelectionChanged.subscribe(this.onEditorSelectionChanged.bind(this)))}initialize(){var e,t;null!==(e=this._browserLink)&&void 0!==e&&e.autoSyncService&&this._browserLink.autoSyncService.changesApplied.subscribe(this.onChangesApplied.bind(this)),null===(t=this._browserLink)||void 0===t||t.sourceMapping.ensureUpToDateAsync((()=>this.setInitialSelection()))}uninitialize(){var e;null!==(e=this._browserLink)&&void 0!==e&&e.autoSyncService&&this._browserLink.autoSyncService.changesApplied.unsubscribe(this.onChangesApplied.bind(this))}onChangesApplied(e){for(const t of e.removed)t===this.selectedLogicalNode&&this.select(null,null,null)}async setInitialSelection(){if(this._browserLink.logicalTree.root){const e=await this._browserLink.currentEditorStateService.getCurrentEditorSelectionPosition();if(null!==e){if(this._browserLink.selectionHostingService.setSelectedLogicalNodeBySourceSpan(e.FileName,e.Position,0))return}const t=new Vn(void 0,this._browserLink).findLeftMostSelectableLeaf(this._browserLink.logicalTree.root);this._selectedNode=t,this.select(null,t,null)}}onEditorSelectionChanged(e,t){if(t&&(t.parentNode!==this._parentNode||t.priorSiblingNode!==this._priorSiblingNode||t.selectedNode!==this._selectedNode)){var i,o;const e=null!==(i=null!==(o=t.selectedNode)&&void 0!==o?o:t.priorSiblingNode)&&void 0!==i?i:t.parentNode;if(e&&!Pn(this._browserLink,e))return;this.select(t.parentNode,t.selectedNode,t.priorSiblingNode,!1)}}get parentNode(){return this._parentNode}get priorSiblingNode(){return this._priorSiblingNode}get selectionChanged(){return this._selectionChanged.asEvent()}get selectedLogicalNode(){return this._selectedNode}selectLogicalNode(e,t){if(Pn(this._browserLink,e)){if(!t)for(;e&&!_n(e);)e=e.parent;e!==this._selectedNode&&this.setupSelection(e)}}selectAtLocation(e,t,i){const o=In(e,this._browserLink);Pn(this._browserLink,o)&&o&&this.setupSelection(o,t,i)}selectDomNode(e){const t=In(e,this._browserLink);Pn(this._browserLink,t)&&t&&this.setupSelection(t)}selectPosition(e,t){const i=null!=t?t:e;Pn(this._browserLink,i)&&this.select(null!=e?e:this.getFirstAncestorThatMapsToDom(t),null,t)}select(e,t,i,o=!0){const n=this._selectedNode,r=this._priorSiblingNode,s=this._parentNode;if(this._selectedNode=t,this._priorSiblingNode=i,this._parentNode=e,n!==this._selectedNode||r!==this._priorSiblingNode||s!==this._parentNode){var a,l;const e={previousSelectedNode:n,previousParentNode:s,previousPriorSiblingNode:r,newSelectedNode:this._selectedNode,newParentNode:this._parentNode,newPriorSiblingNode:this._priorSiblingNode};this._selectionChanged.dispatch(this,e),this._selectionHostingService&&o&&this._selectionHostingService.selectTextInVSEditor(this._selectedNode,this._parentNode,this._priorSiblingNode),this._browserLink.diagnosticLog.writeEvent(7533,null!==(a=null===(l=this._selectedNode)||void 0===l?void 0:l.type)&&void 0!==a?a:"null")}}getFirstAncestorThatMapsToDom(e){let t=null==e?void 0:e.parent;for(;t&&!r(t).mapsToDom;)t=t.parent;return t}setupSelection(e,t=null,i=null){let o=null,n=null,r=null;e&&(this.isNodeSelectable(e)||null==t||null==i?(n=e,o=this.getFirstAncestorThatMapsToDom(e)):(o=e,n=null,r=this.findFirstChildToTheLeft(e,t,i))),this.select(o,n,r)}findFirstChildToTheLeft(e,t,i){let o=0,n=null;for(const r of e.children){const e=this._nodeBoundingClientRectUtil.getBoundingRectForLogicalNode(r);e&&(i>=e.top&&i<=e.bottom&&t>e.right&&e.right>o&&(o=e.right,n=r))}return n}getFirstSelectedDomNode(){const e=this.getAllSelectedDomNodes();return e.length>0?e[0]:null}getAllSelectedDomNodes(){return this.selectedLogicalNode?Tn(this.selectedLogicalNode):[]}isNodeSelectable(e){var t;return!!("Text"===e.type||"Element"===e.type&&(Hn("input",e.tagName)||Hn("button",e.tagName)||Hn("img",e.tagName)||(null===(t=e.tagName)||void 0===t?void 0:t.indexOf(":"))>=0))}}class qn{constructor(e,t,i){this.parentNode=e,this.priorSiblingNode=t,this.selectedNode=i}get hasSelectedNode(){return!!this.selectedNode}get hasSelectedPosition(){return!(!this.parentNode&&!this.priorSiblingNode)}get nextSiblingNode(){let e=null,t=-1;if(this.hasSelectedNode?(e=this.selectedNode.parent,t=e.children.indexOf(this.selectedNode)):this.hasSelectedPosition&&(e=this.parentNode,t=e.children.indexOf(this.priorSiblingNode)),t+1t.start.position&&e=e.selectedNode.length)){n.foundNewMatch=!0,n.newMatch=e;break}}return n}function Yn(e,t,i){const o=Qn(e,t)&&Zn(i,e);for(const o of e.children){const e=Yn(o,t,i);if(e)return e}return o?e:null}function Qn(e,t){var i;return(null===(i=e.start)||void 0===i?void 0:i.path)&&t&&Hn(t,e.start.path)}function Zn(e,t){return e===t.start.position}class Jn{constructor(e){this.browserLink=e,this._editorSelectionChanged=new n.pB,this._selectingFromEditor=!1}get editorSelectionChanged(){return this._editorSelectionChanged.asEvent()}setSelectedLogicalNodeFromEditor(e){try{this._selectingFromEditor=!0,this._editorSelectionChanged.dispatch(this,e)}finally{this._selectingFromEditor=!1}}setSelectedLogicalNodeBySourceSpan(e,t,i){const o=Kn(this.browserLink.logicalTree.root,e,t,i);return!!o&&(this.setSelectedLogicalNodeFromEditor(o),!0)}selectTextInVSEditor(e,t,i){var o,n;this._selectingFromEditor||(!0!==(null==e||null===(o=e.start)||void 0===o||null===(n=o.path)||void 0===n?void 0:n.includes("vseditor"))?e?this.browserLink.sourceMapping.selectCompleteRangeFromLogicalNode(e):i?this.browserLink.sourceMapping.selectPositionAfterLogicalNode(i):t&&this.browserLink.sourceMapping.selectPositionAfterStartTagOfLogicalNode(t):this.browserLink.log(`Trying to select in ${e.start.path}`))}}class er{constructor(e,t,i){this.parentNode=e,this.priorSiblingNode=t,this.selectedNode=i}get isPriorSiblingNodeLastSibling(){return this.parentNode.children.indexOf(this.priorSiblingNode)===this.parentNode.children.length-1}get nextSiblingNodeFromPriorSibling(){if(this.priorSiblingNode){const e=this.priorSiblingNode.parent.children.indexOf(this.priorSiblingNode);if(e0)return this.parentNode.children[0];return null}get priorSiblingNodeFromSelectedNode(){const e=this.selectedNode.parent.children.indexOf(this.selectedNode);return e>0?this.selectedNode.parent.children[e-1]:null}get parentHasChildren(){return this.parentNode.children.length>0}get isSelectedNodeFirstSibling(){return 0===this.selectedNode.parent.children.indexOf(this.selectedNode)}get lastChildOfPriorSibling(){return this.priorSiblingNode.children.length>0?this.priorSiblingNode.children[this.priorSiblingNode.children.length-1]:null}moveRight(){return this.selectedNode?tr(this.selectedNode)?qn.asSelectedPosition(this.selectedNode,null):qn.asSelectedPosition(this.selectedNode.parent,this.selectedNode):this.priorSiblingNode?this.isPriorSiblingNodeLastSibling?qn.asSelectedPosition(this.parentNode.parent,this.parentNode):qn.asSelectedNode(this.nextSiblingNodeFromPriorSibling):this.parentNode?this.parentHasChildren?qn.asSelectedNode(this.nextSiblingNodeFromPriorSibling):qn.asSelectedPosition(this.parentNode.parent,this.parentNode):null}moveLeft(){return this.selectedNode?this.isSelectedNodeFirstSibling?qn.asSelectedPosition(this.selectedNode.parent,null):qn.asSelectedPosition(this.selectedNode.parent,this.priorSiblingNodeFromSelectedNode):this.priorSiblingNode?tr(this.priorSiblingNode)?qn.asSelectedPosition(this.priorSiblingNode,this.lastChildOfPriorSibling):qn.asSelectedNode(this.priorSiblingNode):this.parentNode?qn.asSelectedNode(this.parentNode):null}}function tr(e){if(!e.children||0===e.children.length)return!1;if("Text"===e.children[0].type&&_n(e.children[0])){const t=e.getDomNode(),i=document.createRange();i.selectNodeContents(t);const o=i.getBoundingClientRect();if(o.width>0&&o.height>0)return!0}for(const t of e.children){if(_n(t))return!0;if(tr(t))return!0}return!1}class ir{constructor(e){this.serviceInitialized=!1,this._browserLink=e}updatePositionMap(e){this.positionMap=new Map,this._selectableNonLeafLogicalNodes=[],e?this._selectableLeafLogicalNodes=e:(this._selectableLeafLogicalNodes=[],this.TreeTraverseToFetchAllSelectableNodes(document)),this.setScrollOffset(),this.calculatePositionMap(),this.serviceInitialized=!0}onArrowKeyDown(e){var t,i;const o=this._browserLink.selectionService.selectedLogicalNode,n=this._browserLink.selectionService.priorSiblingNode,r=this._browserLink.selectionService.parentNode,s=this.positionMap;if(!s)return;let a=null,l=null,c=null;const d=new er(r,n,o);let h,u;switch(e.key){case"ArrowRight":h=d.moveRight(),a=h.parentNode,c=h.priorSiblingNode,l=h.selectedNode;break;case"ArrowLeft":h=d.moveLeft(),a=h.parentNode,c=h.priorSiblingNode,l=h.selectedNode;break;case"ArrowUp":var p;if(u=null!==(t=null!=o?o:n)&&void 0!==t?t:r,u)l=null===(p=s.get(u))||void 0===p?void 0:p.upNode;break;case"ArrowDown":var g;if(u=null!==(i=null!=o?o:n)&&void 0!==i?i:r,u)l=null===(g=s.get(u))||void 0===g?void 0:g.downNode}l?this._browserLink.selectionService.selectLogicalNode(l,!0):(a||c)&&this._browserLink.selectionService.selectPosition(a,c)}setScrollOffset(){this._scrollTop=window.scrollY||window.pageYOffset||document.body.scrollTop+(document.documentElement&&document.documentElement.scrollTop||0),this._scrollLeft=window.scrollX||window.pageXOffset||document.body.scrollLeft+(document.documentElement&&document.documentElement.scrollLeft||0)}calculatePositionMap(){for(let e=0;e0&&ir.isDist2Smaller(l,e)&&(l=e,i.downNodeIndex=o)}}return i}static isPossibleUpDownNode(e,t,i,o){if(0==i)return!1;const n=i*Math.tan(o/2*Math.PI/180);return t.bottom<=e.top||t.top>=e.bottom||t.trisection1e.left-n||t.trisection2e.left-n}getAbsolutePosFromBoundingRect(e){return{x:this._scrollLeft+e.left+e.width/2,y:this._scrollTop+e.top+e.height/2,left:this._scrollLeft+e.left,right:this._scrollLeft+e.right,top:this._scrollTop+e.top,bottom:this._scrollTop+e.bottom}}static isDist2Smaller(e,t){return t.rectDiste.right,n=t.top>e.bottom,r=t.bottom0&&i.height>0)return!0}const t=e.getElementsByTagName("*");for(let e=0;e0&&i.height>0&&(o=window.getComputedStyle(t))&&"visible"===o.getPropertyValue("visibility")&&0!=o.getPropertyValue("opacity")&&"none"!==o.getPropertyValue("display"))}TreeTraverseToFetchAllSelectableNodes(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:function(e){return this._browserLink.logicalTree.getFirstLogicalNodeFromDomNode(e)?e.nodeType!==e.TEXT_NODE&&e.nodeType!==Node.ELEMENT_NODE||!ir.IsSelectable(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}.bind(this)});for(;t.nextNode();){const e=t.currentNode;let i=this._browserLink.logicalTree.getFirstLogicalNodeFromDomNode(e);for(;i&&!_n(i);)i=i.parent;ir.hasSelectableChildNode(e)?this._selectableNonLeafLogicalNodes.push(i):this._selectableLeafLogicalNodes.push(i)}}getOrCreatePositionInfo(e,t){if(!e)return null;let i=this.positionMap.get(e);var o;i||(t=null!==(o=t)&&void 0!==o?o:e.getDomNode(),i={upNode:null,downNode:null},this.positionMap.set(e,i));return i}}class or{constructor(){this._statusChanged=new n.pB;const e=Nn("status.connectingToVisualStudio");this._currentStatus={messageType:0,displayText:e,fullText:e},this._targetFilePath=null}get statusChanged(){return this._statusChanged.asEvent()}get targetFilePath(){return this._targetFilePath}set targetFilePath(e){this._targetFilePath=e}get currentStatus(){return this._currentStatus}set currentStatus(e){this._currentStatus!==e&&(this._currentStatus=e,this._statusChanged.dispatch(this,e))}}class nr{constructor(e){this._tagHierarchyChanged=new n.pB,this._browserLink=e,this._tagItemList=[]}initialize(){var e;null!==(e=this._browserLink)&&void 0!==e&&e.autoSyncService&&this._browserLink.autoSyncService.changesApplied.subscribe(this.onChangesApplied.bind(this)),this._browserLink.selectionService.selectionChanged.subscribe(this.onSelectionChanged.bind(this))}get tagItemList(){return this._tagItemList}get selectedTagItem(){return this._selectedTagItem}get parentTagItem(){return this._parentTagItem}get tagHierarchyChanged(){return this._tagHierarchyChanged.asEvent()}getUpdatedTagItem(e){const t=En(e.logicalNode);return{logicalNode:e.logicalNode,truncatedText:t.truncatedText,fullText:t.fullText}}updateTagItemList(){for(let t=0;te.logicalNode===t));-1!==e&&(this._selectedTagItem===this._tagItemList[e]&&(this._selectedTagItem=null),this._tagItemList.splice(e,1))}const t={tagItemList:this.tagItemList,selectedTagItem:this.selectedTagItem,parentTagItem:this.parentTagItem};this._tagHierarchyChanged.dispatch(this,t)}onNavigateHotKeyPressed(e){if(this._selectedTagItem&&this._selectedTagItem)switch(e.key){case"ArrowLeft":{const e=this._tagItemList.indexOf(this._selectedTagItem);e>0&&this._browserLink.selectionService.selectLogicalNode(this._tagItemList[e-1].logicalNode)}break;case"ArrowRight":{const e=this._tagItemList.indexOf(this._selectedTagItem);e{e(this.selectedDomNode)}))}}class ar{constructor(e){this.selection=new sr(e.selectionService)}}class lr{constructor(){this._isConnectedChanged=new n.pB}get isConnected(){return this._isConnected}set isConnected(e){this._isConnected!==e&&(this._isConnected=e,this._isConnectedChanged.dispatch(this,e))}get isConnectedChanged(){return this._isConnectedChanged.asEvent()}}class cr{constructor(){this._isInitialized=!1,this._isInitializedChanged=new n.pB}get isInitialized(){return this._isInitialized}set isInitialized(e){this._isInitialized!==e&&(this._isInitialized=e,this._isInitializedChanged.dispatch(this,e))}get isInitializedChanged(){return this._isInitializedChanged.asEvent()}}class dr{}dr.toggleWLPMenu="ctrl+alt+m",dr.toggleInteractiveMode="ctrl+alt+i",dr.toggleExpandEmptyElementsSetting="ctrl+alt+x",dr.refreshBrowser="ctrl+alt+enter",dr.tagNavigationBarSelectionLeft="shift+alt+left",dr.tagNavigationBarSelectionRight="shift+alt+right",dr.arrowUp="up",dr.arrowDown="down",dr.arrowLeft="left",dr.arrowRight="right",dr.enterTextEditingMode="ctrl+alt+e",dr.escape="escape",dr.enter="enter";class hr{}hr.normalNavigation=[dr.arrowUp,dr.arrowDown,dr.arrowLeft,dr.arrowRight],hr.menuNavigation=[dr.arrowUp,dr.arrowDown],hr.tagNavBarNavigation=[dr.arrowLeft,dr.arrowRight],hr.tagNavBarSelection=[dr.tagNavigationBarSelectionLeft,dr.tagNavigationBarSelectionRight];const ur={max:2147483647,maxMinus1:2147483646},pr={browserLinkScriptElementId:"__browserLink_initializationData",livePreviewRootTagName:"live-preview-root",editableTextParent:"editable-text-parent"},gr="default",fr="text";var vr=i(441),br=i.n(vr);class mr{constructor(e){this.browserLink=e,this._isEnabled=!1,this._isEnabledChanged=new n.FK,this._isReady=!1,this._isReadyChanged=new n.FK,this.isEnabled=this.isEnabledOnLoad}initialize(){vr.bind(dr.toggleInteractiveMode,(()=>{this.isEnabled=!this.isEnabled}),"keydown"),this.browserLink.designSurfaceHostService.setDesignSurfaceEnabledSettingInVS(this.isEnabled)}uninitialize(){vr.unbind(dr.toggleInteractiveMode,"keydown")}get isEnabled(){return this._isEnabled}set isEnabled(e){if(this._isEnabled!==e){this._isEnabled=e,this.isEnabledByStorage=e,this.raiseIsEnabledChanged(),this.browserLink.designSurfaceHostService&&this.browserLink.designSurfaceHostService.setDesignSurfaceEnabledSettingInVS(e);!function(e,t){const i=document.createElement("div"),o="speak-"+Date.now();i.setAttribute("id",o),i.setAttribute("aria-live",t||"polite"),i.classList.add("sr-only"),document.querySelector(pr.livePreviewRootTagName)&&(document.body.appendChild(i),window.setTimeout((function(){document.getElementById(o).innerHTML=e}),100),window.setTimeout((function(){document.body.removeChild(document.getElementById(o))}),1e3))}(Nn(e?"screenReader.inspectorEnabled":"screenReader.inspectorDisabled"),"assertive")}}get isEnabledChanged(){return this._isEnabledChanged.asEvent()}get isReady(){return this._isReady}set isReady(e){this._isReady!==e&&(this._isReady=e,this.raiseIsReadyChanged())}get isReadyChanged(){return this._isReadyChanged.asEvent()}set selectionOverlayElement(e){this._selectionOverlayElement=e}get selectionOverlayElement(){return this._selectionOverlayElement}get isEnabledOnLoad(){return this.isEnabledByUrl&&!this.isDisabledByStorage||this.isEnabledByStorage}raiseIsEnabledChanged(){this._isEnabledChanged.dispatch(this._isEnabled)}raiseIsReadyChanged(){this._isReadyChanged.dispatch(this._isReady)}get isEnabledByUrl(){return"true"===new URLSearchParams(new URL(window.location.href).search).get(mr.SearchParameterName)}get isEnabledByStorage(){return window.sessionStorage.getItem(mr.SessionStorageKey)===(!0).toString()}set isEnabledByStorage(e){window.sessionStorage.setItem(mr.SessionStorageKey,e.toString())}get isDisabledByStorage(){return window.sessionStorage.getItem(mr.SessionStorageKey)===(!1).toString()}}mr.SearchParameterName="vsedit",mr.SessionStorageKey="weblivepreview-designsurface-enabled";class yr{createCSS(){return""}createBehavior(){}}const wr=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;try{return new Function("return this")()}catch(e){return{}}}();void 0===wr.trustedTypes&&(wr.trustedTypes={createPolicy:(e,t)=>t});const xr={configurable:!1,enumerable:!1,writable:!1};void 0===wr.FAST&&Reflect.defineProperty(wr,"FAST",Object.assign({value:Object.create(null)},xr));const kr=wr.FAST;if(void 0===kr.getById){const e=Object.create(null);Reflect.defineProperty(kr,"getById",Object.assign({value(t,i){let o=e[t];return void 0===o&&(o=i?e[t]=i():null),o}},xr))}const Sr=Object.freeze([]),Cr=wr.FAST.getById(1,(()=>{const e=[],t=[];function i(){if(t.length)throw t.shift()}function o(e){try{e.call()}catch(e){t.push(e),setTimeout(i,0)}}function n(){const t=1024;let i=0;for(;it){for(let t=0,o=e.length-i;te});let Nr=$r;const Er=`fast-${Math.random().toString(36).substring(2,8)}`,Lr=`${Er}{`,Tr=`}${Er}`,Or=Object.freeze({supportsAdoptedStyleSheets:Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype,setHTMLPolicy(e){if(Nr!==$r)throw new Error("The HTML policy can only be set once.");Nr=e},createHTML:e=>Nr.createHTML(e),isMarker:e=>e&&8===e.nodeType&&e.data.startsWith(Er),extractDirectiveIndexFromMarker:e=>parseInt(e.data.replace(`${Er}:`,"")),createInterpolationPlaceholder:e=>`${Lr}${e}${Tr}`,createCustomAttributePlaceholder(e,t){return`${e}="${this.createInterpolationPlaceholder(t)}"`},createBlockPlaceholder:e=>`\x3c!--${Er}:${e}--\x3e`,queueUpdate:Cr.enqueue,processUpdates:Cr.process,nextUpdate:()=>new Promise(Cr.enqueue),setAttribute(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i)},setBooleanAttribute(e,t,i){i?e.setAttribute(t,""):e.removeAttribute(t)},removeChildNodes(e){for(let t=e.firstChild;null!==t;t=e.firstChild)e.removeChild(t)},createTemplateWalker:e=>document.createTreeWalker(e,133,null,!1)});class _r{constructor(){this.targets=new WeakSet}addStylesTo(e){this.targets.add(e)}removeStylesFrom(e){this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}}function Ir(e){return e.map((e=>e instanceof _r?Ir(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}function Dr(e){return e.map((e=>e instanceof _r?e.behaviors:null)).reduce(((e,t)=>null===t?e:(null===e&&(e=[]),e.concat(t))),null)}_r.create=(()=>{if(Or.supportsAdoptedStyleSheets){const e=new Map;return t=>new Rr(t,e)}return e=>new Ar(e)})();class Rr extends _r{constructor(e,t){super(),this.styles=e,this.styleSheetCache=t,this._styleSheets=void 0,this.behaviors=Dr(e)}get styleSheets(){if(void 0===this._styleSheets){const e=this.styles,t=this.styleSheetCache;this._styleSheets=Ir(e).map((e=>{if(e instanceof CSSStyleSheet)return e;let i=t.get(e);return void 0===i&&(i=new CSSStyleSheet,i.replaceSync(e),t.set(e,i)),i}))}return this._styleSheets}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.styleSheets],super.addStylesTo(e)}removeStylesFrom(e){const t=this.styleSheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e))),super.removeStylesFrom(e)}}let Pr=0;class Ar extends _r{constructor(e){super(),this.styles=e,this.behaviors=null,this.behaviors=Dr(e),this.styleSheets=Ir(e),this.styleClass=`fast-style-class-${++Pr}`}addStylesTo(e){const t=this.styleSheets,i=this.styleClass;e=this.normalizeTarget(e);for(let o=0;o("string"==typeof t?this.css+=t:e.push(t),e)),[]);i.length&&(this.styles=_r.create(i))}createBehavior(){return this}createCSS(){return this.css}bind(e){this.styles&&e.$fastController.addStyles(this.styles),this.behaviors.length&&e.$fastController.addBehaviors(this.behaviors)}unbind(e){this.styles&&e.$fastController.removeStyles(this.styles),this.behaviors.length&&e.$fastController.removeBehaviors(this.behaviors)}}class Vr{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.source=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const i=t.indexOf(e);-1!==i&&t.splice(i,1)}}notify(e){const t=this.spillover,i=this.source;if(void 0===t){const t=this.sub1,o=this.sub2;void 0!==t&&t.handleChange(i,e),void 0!==o&&o.handleChange(i,e)}else for(let o=0,n=t.length;o{const e=/(:|&&|\|\||if)/,t=new WeakMap,i=new WeakMap,o=Or.queueUpdate;let n,r=e=>{throw new Error("Must call enableArrayObservation before observing arrays.")};function s(e){let i=e.$fastController||t.get(e);return void 0===i&&(Array.isArray(e)?i=r(e):t.set(e,i=new jr(e))),i}function a(e){let t=i.get(e);if(void 0===t){let o=Reflect.getPrototypeOf(e);for(;void 0===t&&null!==o;)t=i.get(o),o=Reflect.getPrototypeOf(o);t=void 0===t?[]:t.slice(0),i.set(e,t)}return t}class l{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const i=this.field,o=e[i];if(o!==t){e[i]=t;const n=e[this.callback];"function"==typeof n&&n.call(e,o,t),s(e).notify(this.name)}}}class c extends Vr{constructor(e,t,i=!1){super(e,t),this.binding=e,this.isVolatileBinding=i,this.needsRefresh=!0,this.needsQueue=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}observe(e,t){this.needsRefresh&&null!==this.last&&this.disconnect();const i=n;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;const o=this.binding(e,t);return n=i,o}disconnect(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=!0}}watch(e,t){const i=this.last,o=s(e),r=null===i?this.first:{};if(r.propertySource=e,r.propertyName=t,r.notifier=o,o.subscribe(this,t),null!==i){if(!this.needsRefresh){let t;n=void 0,t=i.propertySource[i.propertyName],n=this,e===t&&(this.needsRefresh=!0)}i.next=r}this.last=r}handleChange(){this.needsQueue&&(this.needsQueue=!1,o(this))}call(){null!==this.last&&(this.needsQueue=!0,this.notify(this))}records(){let e=this.first;return{next:()=>{const t=e;return void 0===t?{value:void 0,done:!0}:(e=e.next,{value:t,done:!1})},[Symbol.iterator]:function(){return this}}}}return Object.freeze({setArrayObserverFactory(e){r=e},getNotifier:s,track(e,t){void 0!==n&&n.watch(e,t)},trackVolatile(){void 0!==n&&(n.needsRefresh=!0)},notify(e,t){s(e).notify(t)},defineProperty(e,t){"string"==typeof t&&(t=new l(t)),a(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get:function(){return t.getValue(this)},set:function(e){t.setValue(this,e)}})},getAccessors:a,binding(e,t,i=this.isVolatileBinding(e)){return new c(e,t,i)},isVolatileBinding:t=>e.test(t.toString())})}));function Hr(e,t){zr.defineProperty(e,t)}function Ur(e,t,i){return Object.assign({},i,{get:function(){return zr.trackVolatile(),i.get.apply(this)}})}const qr=kr.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}}));class Kr{constructor(){this.index=0,this.length=0,this.parent=null,this.parentContext=null}get event(){return qr.get()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}static setEvent(e){qr.set(e)}}zr.defineProperty(Kr.prototype,"index"),zr.defineProperty(Kr.prototype,"length");const Wr=Object.seal(new Kr);class Gr{constructor(){this.targetIndex=0}}class Xr extends Gr{constructor(){super(...arguments),this.createPlaceholder=Or.createInterpolationPlaceholder}}class Yr extends Gr{constructor(e,t,i){super(),this.name=e,this.behavior=t,this.options=i}createPlaceholder(e){return Or.createCustomAttributePlaceholder(this.name,e)}createBehavior(e){return new this.behavior(e,this.options)}}function Qr(e,t){this.source=e,this.context=t,null===this.bindingObserver&&(this.bindingObserver=zr.binding(this.binding,this,this.isBindingVolatile)),this.updateTarget(this.bindingObserver.observe(e,t))}function Zr(e,t){this.source=e,this.context=t,this.target.addEventListener(this.targetName,this)}function Jr(){this.bindingObserver.disconnect(),this.source=null,this.context=null}function es(){this.bindingObserver.disconnect(),this.source=null,this.context=null;const e=this.target.$fastView;void 0!==e&&e.isComposed&&(e.unbind(),e.needsBindOnly=!0)}function ts(){this.target.removeEventListener(this.targetName,this),this.source=null,this.context=null}function is(e){Or.setAttribute(this.target,this.targetName,e)}function os(e){Or.setBooleanAttribute(this.target,this.targetName,e)}function ns(e){if(null==e&&(e=""),e.create){this.target.textContent="";let t=this.target.$fastView;void 0===t?t=e.create():this.target.$fastTemplate!==e&&(t.isComposed&&(t.remove(),t.unbind()),t=e.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(this.source,this.context)):(t.isComposed=!0,t.bind(this.source,this.context),t.insertBefore(this.target),this.target.$fastView=t,this.target.$fastTemplate=e)}else{const t=this.target.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),this.target.textContent=e}}function rs(e){this.target[this.targetName]=e}function ss(e){const t=this.classVersions||Object.create(null),i=this.target;let o=this.version||0;if(null!=e&&e.length){const n=e.split(/\s+/);for(let e=0,r=n.length;eOr.createHTML(e(t,i))}break;case"?":this.cleanedTargetName=e.substr(1),this.updateTarget=os;break;case"@":this.cleanedTargetName=e.substr(1),this.bind=Zr,this.unbind=ts;break;default:this.cleanedTargetName=e,"class"===e&&(this.updateTarget=ss)}}targetAtContent(){this.updateTarget=ns,this.unbind=es}createBehavior(e){return new ls(e,this.binding,this.isBindingVolatile,this.bind,this.unbind,this.updateTarget,this.cleanedTargetName)}}class ls{constructor(e,t,i,o,n,r,s){this.source=null,this.context=null,this.bindingObserver=null,this.target=e,this.binding=t,this.isBindingVolatile=i,this.bind=o,this.unbind=n,this.updateTarget=r,this.targetName=s}handleChange(){this.updateTarget(this.bindingObserver.observe(this.source,this.context))}handleEvent(e){Kr.setEvent(e);const t=this.binding(this.source,this.context);Kr.setEvent(null),!0!==t&&e.preventDefault()}}let cs=null;class ds{addFactory(e){e.targetIndex=this.targetIndex,this.behaviorFactories.push(e)}captureContentBinding(e){e.targetAtContent(),this.addFactory(e)}reset(){this.behaviorFactories=[],this.targetIndex=-1}release(){cs=this}static borrow(e){const t=cs||new ds;return t.directives=e,t.reset(),cs=null,t}}function hs(e){if(1===e.length)return e[0];let t;const i=e.length,o=e.map((e=>"string"==typeof e?()=>e:(t=e.targetName||t,e.binding))),n=new as(((e,t)=>{let n="";for(let r=0;ra)),c.targetName=s.name):c=hs(l),null!==c&&(t.removeAttributeNode(s),n--,r--,e.addFactory(c))}}function fs(e,t,i){const o=ps(e,t.textContent);if(null!==o){let n=t;for(let r=0,s=o.length;r0}const t=this.fragment.cloneNode(!0),i=this.viewBehaviorFactories,o=new Array(this.behaviorCount),n=Or.createTemplateWalker(t);let r=0,s=this.targetOffset,a=n.nextNode();for(let e=i.length;r=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function ws(e,...t){const i=[];let o="";for(let n=0,r=e.length-1;ne}if("function"==typeof s&&(s=new as(s)),s instanceof Xr){const e=ys.exec(r);null!==e&&(s.targetName=e[2])}s instanceof Gr?(o+=s.createPlaceholder(i.length),i.push(s)):o+=s}return o+=e[e.length-1],new ms(o,i)}function xs(e,t){const i="function"==typeof t?t:()=>t;return(t,o)=>e(t,o)?i(t,o):null}class ks{constructor(e,t){this.target=e,this.propertyName=t}bind(e){e[this.propertyName]=this.target}unbind(){}}function Ss(e){return new Yr("fast-ref",ks,e)}const Cs={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},$s={toView(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t.toString()},fromView(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}};class Ns{constructor(e,t,i=t.toLowerCase(),o="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=i,this.mode=o,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===o&&void 0===n&&(this.converter=Cs)}setValue(e,t){const i=e[this.fieldName],o=this.converter;void 0!==o&&(t=o.fromView(t)),i!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](i,t),e.$fastController.notify(this.name))}getValue(e){return zr.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,i=this.guards;i.has(e)||"fromView"===t||Or.queueUpdate((()=>{i.add(e);const o=e[this.fieldName];switch(t){case"reflect":const t=this.converter;Or.setAttribute(e,this.attribute,void 0!==t?t.toView(o):o);break;case"boolean":Or.setBooleanAttribute(e,this.attribute,o)}i.delete(e)}))}static collect(e,...t){const i=[];t.push(e.attributes);for(let o=0,n=t.length;o1&&(i.property=t);const o=e.constructor.attributes||(e.constructor.attributes=[]);o.push(i)}return arguments.length>1?(i={},void o(e,t)):(i=void 0===e?{}:e,o)}const Ls={mode:"open"},Ts={},Os=kr.getById(4,(()=>{const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t)})}));class _s{constructor(e,t=e.definition){"string"==typeof t&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template;const i=Ns.collect(e,t.attributes),o=new Array(i.length),n={},r={};for(let e=0,t=i.length;e0){const t=this.boundObservables=Object.create(null);for(let i=0,n=o.length;iAs(e),define:(e,t)=>new _s(e,t).define().type});function Bs(e){return function(t){new _s(t,e).define()}}const Ms=new Map;"metadata"in Reflect||(Reflect.metadata=function(e,t){return function(i){Reflect.defineMetadata(e,t,i)}},Reflect.defineMetadata=function(e,t,i){let o=Ms.get(i);void 0===o&&Ms.set(i,o=new Map),o.set(e,t)},Reflect.getOwnMetadata=function(e,t){const i=Ms.get(t);if(void 0!==i)return i.get(e)});class Vs{constructor(e,t){this.container=e,this.key=t}instance(e){return this.registerResolver(0,e)}singleton(e){return this.registerResolver(1,e)}transient(e){return this.registerResolver(2,e)}callback(e){return this.registerResolver(3,e)}cachedCallback(e){return this.registerResolver(3,ua(e))}aliasTo(e){return this.registerResolver(5,e)}registerResolver(e,t){const{container:i,key:o}=this;return this.container=this.key=void 0,i.registerResolver(o,new ea(o,e,t))}}function js(e){const t=e.slice(),i=Object.keys(e),o=i.length;let n;for(let r=0;rnew ea(e,1,e),transient:e=>new ea(e,2,e)}),Hs=Object.freeze({default:Object.freeze({parentLocator:()=>null,responsibleForOwnerRequests:!1,defaultResolver:zs.singleton})}),Us=new Map;function qs(e){return t=>Reflect.getOwnMetadata(e,t)}let Ks=null;const Ws=Object.freeze({createContainer:e=>new da(null,Object.assign({},Hs.default,e)),findResponsibleContainer(e){const t=e.$$container$$;return t&&t.responsibleForOwnerRequests?t:Ws.findParentContainer(e)},findParentContainer(e){const t=new CustomEvent(la,{bubbles:!0,composed:!0,cancelable:!0,detail:{container:void 0}});return e.dispatchEvent(t),t.detail.container||Ws.getOrCreateDOMContainer()},getOrCreateDOMContainer:(e,t)=>e?e.$$container$$||new da(e,Object.assign({},Hs.default,t,{parentLocator:Ws.findParentContainer})):Ks||(Ks=new da(null,Object.assign({},Hs.default,t,{parentLocator:()=>null}))),getDesignParamtypes:qs("design:paramtypes"),getAnnotationParamtypes:qs("di:paramtypes"),getOrCreateAnnotationParamTypes(e){let t=this.getAnnotationParamtypes(e);return void 0===t&&Reflect.defineMetadata("di:paramtypes",t=[],e),t},getDependencies(e){let t=Us.get(e);if(void 0===t){const i=e.inject;if(void 0===i){const i=Ws.getDesignParamtypes(e),o=Ws.getAnnotationParamtypes(e);if(void 0===i)if(void 0===o){const i=Object.getPrototypeOf(e);t="function"==typeof i&&i!==Function.prototype?js(Ws.getDependencies(i)):[]}else t=js(o);else if(void 0===o)t=js(i);else{t=js(i);let e,n=o.length;for(let i=0;i{Ws.findResponsibleContainer(this).get(i)!==this[n]&&(this[n]=e,o.notify(t))};o.subscribe({handleChange:r},"isConnected")}}return e}})},createInterface(e,t){const i="function"==typeof e?e:t,o="string"==typeof e?e:e&&"friendlyName"in e&&e.friendlyName||va,n="string"!=typeof e&&(e&&"respectConnection"in e&&e.respectConnection||!1),r=function(e,t,i){if(null==e||void 0!==new.target)throw new Error(`No registration for interface: '${r.friendlyName}'`);if(t)Ws.defineProperty(e,t,r,n);else{Ws.getOrCreateAnnotationParamTypes(e)[i]=r}};return r.$isInterface=!0,r.friendlyName=null==o?"(anonymous)":o,null!=i&&(r.register=function(e,t){return i(new Vs(e,null!=t?t:r))}),r.toString=function(){return`InterfaceSymbol<${r.friendlyName}>`},r},inject:(...e)=>function(t,i,o){if("number"==typeof o){const i=Ws.getOrCreateAnnotationParamTypes(t),n=e[0];void 0!==n&&(i[o]=n)}else if(i)Ws.defineProperty(t,i,e[0]);else{const i=o?Ws.getOrCreateAnnotationParamTypes(o.value):Ws.getOrCreateAnnotationParamTypes(t);let n;for(let t=0;t(e.register=function(t){return pa.transient(e,e).register(t)},e.registerInRequestor=!1,e),singleton:(e,t=Ys)=>(e.register=function(t){return pa.singleton(e,e).register(t)},e.registerInRequestor=t.scoped,e)}),Gs=Ws.createInterface("Container");function Xs(e){return function(t){const i=function(e,t,o){Ws.inject(i)(e,t,o)};return i.$isResolver=!0,i.resolve=function(i,o){return e(t,i,o)},i}}Ws.inject;const Ys={scoped:!1};Qs=(e,t,i,o)=>i.getAll(e,o);var Qs;Xs(((e,t,i)=>()=>i.get(e))),Xs(((e,t,i)=>i.has(e,!0)?i.get(e):void 0));function Zs(e,t,i){Ws.inject(Zs)(e,t,i)}Zs.$isResolver=!0,Zs.resolve=()=>{};Xs(((e,t,i)=>{const o=Js(e,t),n=new ea(e,0,o);return i.registerResolver(e,n),o})),Xs(((e,t,i)=>Js(e,t)));function Js(e,t){return t.getFactory(e).construct(t)}class ea{constructor(e,t,i){this.key=e,this.strategy=t,this.state=i,this.resolving=!1}get $isResolver(){return!0}register(e){return e.registerResolver(this.key,this)}resolve(e,t){switch(this.strategy){case 0:return this.state;case 1:if(this.resolving)throw new Error(`Cyclic dependency found: ${this.state.name}`);return this.resolving=!0,this.state=e.getFactory(this.state).construct(t),this.strategy=0,this.resolving=!1,this.state;case 2:{const i=e.getFactory(this.state);if(null===i)throw new Error(`Resolver for ${String(this.key)} returned a null factory`);return i.construct(t)}case 3:return this.state(e,t,this);case 4:return this.state[0].resolve(e,t);case 5:return t.get(this.state);default:throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`)}}getFactory(e){var t,i,o;switch(this.strategy){case 1:case 2:return e.getFactory(this.state);case 5:return null!==(o=null===(i=null===(t=e.getResolver(this.state))||void 0===t?void 0:t.getFactory)||void 0===i?void 0:i.call(t,e))&&void 0!==o?o:null;default:return null}}}function ta(e){return this.get(e)}function ia(e,t){return t(e)}class oa{constructor(e,t){this.Type=e,this.dependencies=t,this.transformers=null}construct(e,t){let i;return i=void 0===t?new this.Type(...this.dependencies.map(ta,e)):new this.Type(...this.dependencies.map(ta,e),...t),null==this.transformers?i:this.transformers.reduce(ia,i)}registerTransformer(e){(this.transformers||(this.transformers=[])).push(e)}}const na={$isResolver:!0,resolve:(e,t)=>t};function ra(e){return"function"==typeof e.register}function sa(e){return function(e){return ra(e)&&"boolean"==typeof e.registerInRequestor}(e)&&e.registerInRequestor}const aa=new Set(["Array","ArrayBuffer","Boolean","DataView","Date","Error","EvalError","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Number","Object","Promise","RangeError","ReferenceError","RegExp","Set","SharedArrayBuffer","String","SyntaxError","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakSet"]),la="__DI_LOCATE_PARENT__",ca=new Map;class da{constructor(e,t){this.owner=e,this.config=t,this._parent=void 0,this.registerDepth=0,this.context=null,null!==e&&(e.$$container$$=this),this.resolvers=new Map,this.resolvers.set(Gs,na),e instanceof Node&&e.addEventListener(la,(e=>{e.composedPath()[0]!==this.owner&&(e.detail.container=this,e.stopImmediatePropagation())}))}get parent(){return void 0===this._parent&&(this._parent=this.config.parentLocator(this.owner)),this._parent}get depth(){return null===this.parent?0:this.parent.depth+1}get responsibleForOwnerRequests(){return this.config.responsibleForOwnerRequests}registerWithContext(e,...t){return this.context=e,this.register(...t),this.context=null,this}register(...e){if(100==++this.registerDepth)throw new Error("Unable to autoregister dependency");let t,i,o,n,r;const s=this.context;for(let a=0,l=e.length;athis}))}jitRegister(e,t){if("function"!=typeof e)throw new Error(`Attempted to jitRegister something that is not a constructor: '${e}'. Did you forget to register this dependency?`);if(aa.has(e.name))throw new Error(`Attempted to jitRegister an intrinsic type: ${e.name}. Did you forget to add @inject(Key)`);if(ra(e)){const i=e.register(t);if(!(i instanceof Object)||null==i.resolve){const i=t.resolvers.get(e);if(null!=i)return i;throw new Error("A valid resolver was not returned from the static register method")}return i}if(e.$isInterface)throw new Error(`Attempted to jitRegister an interface: ${e.friendlyName}`);{const i=this.config.defaultResolver(e,t);return t.resolvers.set(e,i),i}}}const ha=new WeakMap;function ua(e){return function(t,i,o){if(ha.has(o))return ha.get(o);const n=e(t,i,o);return ha.set(o,n),n}}const pa=Object.freeze({instance:(e,t)=>new ea(e,0,t),singleton:(e,t)=>new ea(e,1,t),transient:(e,t)=>new ea(e,2,t),callback:(e,t)=>new ea(e,3,t),cachedCallback:(e,t)=>new ea(e,3,ua(t)),aliasTo:(e,t)=>new ea(t,5,e)});function ga(e){if(null==e)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}function fa(e,t,i){if(e instanceof ea&&4===e.strategy){const o=e.state;let n=o.length;const r=new Array(n);for(;n--;)r[n]=o[n].resolve(t,i);return r}return[e.resolve(t,i)]}const va="(anonymous)";function ba(e){return"object"==typeof e&&null!==e||"function"==typeof e}const ma=function(){const e=new WeakMap;let t=!1,i="",o=0;return function(n){return t=e.get(n),void 0===t&&(i=n.toString(),o=i.length,t=o>=29&&o<=100&&125===i.charCodeAt(o-1)&&i.charCodeAt(o-2)<=32&&93===i.charCodeAt(o-3)&&101===i.charCodeAt(o-4)&&100===i.charCodeAt(o-5)&&111===i.charCodeAt(o-6)&&99===i.charCodeAt(o-7)&&32===i.charCodeAt(o-8)&&101===i.charCodeAt(o-9)&&118===i.charCodeAt(o-10)&&105===i.charCodeAt(o-11)&&116===i.charCodeAt(o-12)&&97===i.charCodeAt(o-13)&&110===i.charCodeAt(o-14)&&88===i.charCodeAt(o-15),e.set(n,t)),t}}(),ya={};function wa(e){switch(typeof e){case"number":return e>=0&&(0|e)===e;case"string":{const t=ya[e];if(void 0!==t)return t;const i=e.length;if(0===i)return ya[e]=!1;let o=0;for(let t=0;t1||o<48||o>57)return ya[e]=!1;return ya[e]=!0}default:return!1}}const xa=Ws.createInterface(),ka=Ws.createInterface(),Sa=Ws.createInterface(),Ca=Ws.createInterface(),$a=Ws.createInterface(),Na=Ws.createInterface(),Ea=Ws.createInterface(),La=Ws.createInterface(),Ta=Ws.createInterface(),Oa=Ws.createInterface(),_a=Ws.createInterface(),Ia=Ws.createInterface(),Da=Ws.createInterface(),Ra=Ws.createInterface(),Pa=Ws.createInterface(),Aa=Ws.createInterface(),Fa=Ws.createInterface(),Ba=Ws.createInterface();var Ma=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s},Va=void 0&&(void 0).__param||function(e,t){return function(i,o){t(i,o,e)}};let ja=class{constructor(e){this.elementsFromPoint=(e,t)=>this.browserLink.disableUserPageInteractionsService.runUserPageInteractionFunction((()=>this.elementsFromPointInternal(e,t)),[]),this.elementsFromPointInternal=(e,t)=>document.elementsFromPoint?document.elementsFromPoint(e,t):document["msElementsFromPoint"]?document["msElementsFromPoint"](e,t):null,this.nodeFromPoint=(e,t)=>{const i=this.elementsFromPoint(e,t);if(!i)return null;const o=i[1];for(let i=0;ii.left&&ei.top&&t{let n=null,r=Number.MAX_VALUE;for(let s=0;sl.right&&(c=e-l.right),tl.bottom&&(d=t-l.bottom);const h=c*c+d*d;h!a(e)&&"#text"===e.nodeName.toLowerCase(),this.browserLink=e}getDroppableLogicalContainerNodeAtPoint(e,t,i){const o=this.elementsFromPoint(e,t);let n;for(let e=0;e=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const Ha=Br` :host { z-index: var(--wlp-zIndex); } .menuButton_container { position: fixed; height: var(--wlp-status-bar-height); bottom: 0; left: 0; font: var(--body-font); } .disconnectedOverlay { position: fixed; background-color: black; top: 0; left: 0; right: 0; bottom: 0; z-index: var(--wlp-zIndex); opacity: 0.7; } `,Ua=ws` ${xs((e=>e.isDesignSurfaceEnabled||e.isDesignSurfaceReady),ws`
${xs((e=>e.isDesignSurfaceEnabled),ws` ${xs((e=>e.isInitializingLogicalTree||!e.isBrowserLinkConnected),ws`
`)} ${xs((e=>!e.isInitializingLogicalTree),ws` `)} e.handleDrag(t.event)} @dragover=${(e,t)=>e.handleDrag(t.event)}> `)} ${xs((e=>!e.isDesignSurfaceEnabled),ws` `)}
`)} `;let qa=class extends Fs{constructor(){super(...arguments),this.toggleMenu=()=>{var e,t;this.isDesignSurfaceEnabled?null===(e=this.statusBar)||void 0===e||e.toggleMenu():null===(t=this.floatingStartButton)||void 0===t||t.toggleMenu()},this.handleDesignSurfaceIsEnabledChanged=()=>{this.isDesignSurfaceEnabled=this.designSurfaceService.isEnabled},this.handleDesignSurfaceIsReadyChanged=()=>{this.isDesignSurfaceReady=this.designSurfaceService.isReady},this.handleIsInitializedChanged=(e,t)=>{this.isInitializingLogicalTree=!t},this.handleIsBrowserLinkConnectedChanged=(e,t)=>{this.isBrowserLinkConnected=t}}connectedCallback(){super.connectedCallback(),vr.bind(dr.toggleWLPMenu,this.toggleMenu,"keyup"),this.checkBrowserLinkState(),this.attachBrowserLinkEvents()}disconnectedCallback(){super.disconnectedCallback(),vr.unbind(dr.toggleWLPMenu,"keyup"),this.detachBrowserLinkEvents()}handleDrag(e){e.dataTransfer.dropEffect="none",e.dataTransfer.effectAllowed="none"}checkBrowserLinkState(){this.isInitializingLogicalTree=!this.logicalTreeInitializedStatusService.isInitialized,this.isBrowserLinkConnected=this.browserLinkConnectionStatusService.isConnected,this.isDesignSurfaceEnabled=this.designSurfaceService.isEnabled,this.isDesignSurfaceReady=this.designSurfaceService.isReady}attachBrowserLinkEvents(){this.browserLinkConnectionStatusService.isConnectedChanged.subscribe(this.handleIsBrowserLinkConnectedChanged),this.logicalTreeInitializedStatusService.isInitializedChanged.subscribe(this.handleIsInitializedChanged),this.designSurfaceService.isEnabledChanged.subscribe(this.handleDesignSurfaceIsEnabledChanged),this.designSurfaceService.isReadyChanged.subscribe(this.handleDesignSurfaceIsReadyChanged)}detachBrowserLinkEvents(){this.browserLinkConnectionStatusService.isConnectedChanged.unsubscribe(this.handleIsBrowserLinkConnectedChanged),this.logicalTreeInitializedStatusService.isInitializedChanged.unsubscribe(this.handleIsInitializedChanged),this.designSurfaceService.isEnabledChanged.unsubscribe(this.handleDesignSurfaceIsEnabledChanged),this.designSurfaceService.isReadyChanged.unsubscribe(this.handleDesignSurfaceIsReadyChanged)}};function Ka(e,t,i){return isNaN(e)||e<=t?t:e>=i?i:e}function Wa(e,t,i){return isNaN(e)||e<=t?0:e>=i?1:e/(i-t)}function Ga(e,t,i){return isNaN(e)?t:t+e*(i-t)}function Xa(e){return e*(Math.PI/180)}function Ya(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:t+e*(i-t)}function Qa(e,t,i){if(e<=0)return t%360;if(e>=1)return i%360;const o=(t-i+360)%360;return o<=(i-t+360)%360?(t-o*e+360)%360:(t+o*e+360)%360}za([Na],qa.prototype,"logicalTreeInitializedStatusService",void 0),za([$a],qa.prototype,"browserLinkConnectionStatusService",void 0),za([Da],qa.prototype,"designSurfaceService",void 0),za([Aa],qa.prototype,"nodesFromAreaUtil",void 0),za([Fa],qa.prototype,"nodeBoundingClientRectUtil",void 0),za([Hr],qa.prototype,"isBrowserLinkConnected",void 0),za([Hr],qa.prototype,"isInitializingLogicalTree",void 0),za([Hr],qa.prototype,"isDesignSurfaceEnabled",void 0),za([Hr],qa.prototype,"isDesignSurfaceReady",void 0),qa=za([Bs({name:pr.livePreviewRootTagName,template:Ua,styles:Ha})],qa);Math.PI;function Za(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Ja{constructor(e,t,i,o){this.r=e,this.g=t,this.b=i,this.a="number"!=typeof o||isNaN(o)?1:o}static fromObject(e){return!e||isNaN(e.r)||isNaN(e.g)||isNaN(e.b)?null:new Ja(e.r,e.g,e.b,e.a)}equalValue(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}toStringHexRGB(){return"#"+[this.r,this.g,this.b].map(this.formatHexValue).join("")}toStringHexRGBA(){return this.toStringHexRGB()+this.formatHexValue(this.a)}toStringHexARGB(){return"#"+[this.a,this.r,this.g,this.b].map(this.formatHexValue).join("")}toStringWebRGB(){return`rgb(${Math.round(Ga(this.r,0,255))},${Math.round(Ga(this.g,0,255))},${Math.round(Ga(this.b,0,255))})`}toStringWebRGBA(){return`rgba(${Math.round(Ga(this.r,0,255))},${Math.round(Ga(this.g,0,255))},${Math.round(Ga(this.b,0,255))},${Ka(this.a,0,1)})`}roundToPrecision(e){return new Ja(Za(this.r,e),Za(this.g,e),Za(this.b,e),Za(this.a,e))}clamp(){return new Ja(Ka(this.r,0,1),Ka(this.g,0,1),Ka(this.b,0,1),Ka(this.a,0,1))}toObject(){return{r:this.r,g:this.g,b:this.b,a:this.a}}formatHexValue(e){return function(e){const t=Math.round(Ka(e,0,255)).toString(16);return 1===t.length?"0"+t:t}(Ga(e,0,255))}}class el{constructor(e,t,i){this.h=e,this.s=t,this.l=i}static fromObject(e){return!e||isNaN(e.h)||isNaN(e.s)||isNaN(e.l)?null:new el(e.h,e.s,e.l)}equalValue(e){return this.h===e.h&&this.s===e.s&&this.l===e.l}roundToPrecision(e){return new el(Za(this.h,e),Za(this.s,e),Za(this.l,e))}toObject(){return{h:this.h,s:this.s,l:this.l}}}class tl{constructor(e,t,i){this.h=e,this.s=t,this.v=i}static fromObject(e){return!e||isNaN(e.h)||isNaN(e.s)||isNaN(e.v)?null:new tl(e.h,e.s,e.v)}equalValue(e){return this.h===e.h&&this.s===e.s&&this.v===e.v}roundToPrecision(e){return new tl(Za(this.h,e),Za(this.s,e),Za(this.v,e))}toObject(){return{h:this.h,s:this.s,v:this.v}}}class il{constructor(e,t,i){this.l=e,this.a=t,this.b=i}static fromObject(e){return!e||isNaN(e.l)||isNaN(e.a)||isNaN(e.b)?null:new il(e.l,e.a,e.b)}equalValue(e){return this.l===e.l&&this.a===e.a&&this.b===e.b}roundToPrecision(e){return new il(Za(this.l,e),Za(this.a,e),Za(this.b,e))}toObject(){return{l:this.l,a:this.a,b:this.b}}}il.epsilon=216/24389,il.kappa=24389/27;class ol{constructor(e,t,i){this.l=e,this.c=t,this.h=i}static fromObject(e){return!e||isNaN(e.l)||isNaN(e.c)||isNaN(e.h)?null:new ol(e.l,e.c,e.h)}equalValue(e){return this.l===e.l&&this.c===e.c&&this.h===e.h}roundToPrecision(e){return new ol(Za(this.l,e),Za(this.c,e),Za(this.h,e))}toObject(){return{l:this.l,c:this.c,h:this.h}}}class nl{constructor(e,t,i){this.x=e,this.y=t,this.z=i}static fromObject(e){return!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.z)?null:new nl(e.x,e.y,e.z)}equalValue(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}roundToPrecision(e){return new nl(Za(this.x,e),Za(this.y,e),Za(this.z,e))}toObject(){return{x:this.x,y:this.y,z:this.z}}}function rl(e){return.2126*e.r+.7152*e.g+.0722*e.b}function sl(e){function t(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}return rl(new Ja(t(e.r),t(e.g),t(e.b),1))}nl.whitePoint=new nl(.95047,1,1.08883);const al=(e,t)=>(e+.05)/(t+.05);function ll(e,t){const i=sl(e),o=sl(t);return i>o?al(i,o):al(o,i)}function cl(e){const t=Math.max(e.r,e.g,e.b),i=Math.min(e.r,e.g,e.b),o=t-i;let n=0;0!==o&&(n=t===e.r?60*((e.g-e.b)/o%6):t===e.g?60*((e.b-e.r)/o+2):60*((e.r-e.g)/o+4)),n<0&&(n+=360);const r=(t+i)/2;let s=0;return 0!==o&&(s=o/(1-Math.abs(2*r-1))),new el(n,s,r)}function dl(e,t=1){const i=(1-Math.abs(2*e.l-1))*e.s,o=i*(1-Math.abs(e.h/60%2-1)),n=e.l-i/2;let r=0,s=0,a=0;return e.h<60?(r=i,s=o,a=0):e.h<120?(r=o,s=i,a=0):e.h<180?(r=0,s=i,a=o):e.h<240?(r=0,s=o,a=i):e.h<300?(r=o,s=0,a=i):e.h<360&&(r=i,s=0,a=o),new Ja(r+n,s+n,a+n,t)}function hl(e){const t=Math.max(e.r,e.g,e.b),i=t-Math.min(e.r,e.g,e.b);let o=0;0!==i&&(o=t===e.r?60*((e.g-e.b)/i%6):t===e.g?60*((e.b-e.r)/i+2):60*((e.r-e.g)/i+4)),o<0&&(o+=360);let n=0;return 0!==t&&(n=i/t),new tl(o,n,t)}function ul(e){let t=0;(Math.abs(e.b)>.001||Math.abs(e.a)>.001)&&(t=Math.atan2(e.b,e.a)*(180/Math.PI)),t<0&&(t+=360);const i=Math.sqrt(e.a*e.a+e.b*e.b);return new ol(e.l,i,t)}function pl(e){function t(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}const i=t(e.r),o=t(e.g),n=t(e.b);return new nl(.4124564*i+.3575761*o+.1804375*n,.2126729*i+.7151522*o+.072175*n,.0193339*i+.119192*o+.9503041*n)}function gl(e,t=1){function i(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055}const o=i(3.2404542*e.x-1.5371385*e.y-.4985314*e.z),n=i(-.969266*e.x+1.8760108*e.y+.041556*e.z),r=i(.0556434*e.x-.2040259*e.y+1.0572252*e.z);return new Ja(o,n,r,t)}function fl(e){return function(e){function t(e){return e>il.epsilon?Math.pow(e,1/3):(il.kappa*e+16)/116}const i=t(e.x/nl.whitePoint.x),o=t(e.y/nl.whitePoint.y),n=t(e.z/nl.whitePoint.z);return new il(116*o-16,500*(i-o),200*(o-n))}(pl(e))}function vl(e,t=1){return gl(function(e){const t=(e.l+16)/116,i=t+e.a/500,o=t-e.b/200,n=Math.pow(i,3),r=Math.pow(t,3),s=Math.pow(o,3);let a=0;a=n>il.epsilon?n:(116*i-16)/il.kappa;let l=0;l=e.l>il.epsilon*il.kappa?r:e.l/il.kappa;let c=0;return c=s>il.epsilon?s:(116*o-16)/il.kappa,a=nl.whitePoint.x*a,l=nl.whitePoint.y*l,c=nl.whitePoint.z*c,new nl(a,l,c)}(e),t)}function bl(e){return ul(fl(e))}function ml(e,t=1){return vl(function(e){let t=0,i=0;return 0!==e.h&&(t=Math.cos(Xa(e.h))*e.c,i=Math.sin(Xa(e.h))*e.c),new il(e.l,t,i)}(e),t)}function yl(e,t){const i=e.relativeLuminance>t.relativeLuminance?e:t,o=e.relativeLuminance>t.relativeLuminance?t:e;return(i.relativeLuminance+.05)/(o.relativeLuminance+.05)}const wl=Object.freeze({create:(e,t,i)=>new xl(e,t,i),from:e=>new xl(e.r,e.g,e.b)});class xl extends Ja{constructor(e,t,i){super(e,t,i,1),this.toColorString=this.toStringHexRGB,this.contrast=yl.bind(null,this),this.createCSS=this.toColorString,this.relativeLuminance=sl(this)}static fromObject(e){return new xl(e.r,e.g,e.b)}}function kl(e){return wl.create(e,e,e)}const Sl=1,Cl=.23;function $l(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s}function Nl(e){const t=e.parentElement;if(t)return t;{const t=e.getRootNode();if(t.host instanceof HTMLElement)return t.host}return null}const El=document.createElement("div");class Ll{setProperty(e,t){Or.queueUpdate((()=>this.target.setProperty(e,t)))}removeProperty(e){Or.queueUpdate((()=>this.target.removeProperty(e)))}}class Tl extends Ll{constructor(){super();const e=new CSSStyleSheet;this.target=e.cssRules[e.insertRule(":root{}")].style,document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}}class Ol extends Ll{constructor(){super(),this.style=document.createElement("style"),document.head.appendChild(this.style);const{sheet:e}=this.style;if(e){const t=e.insertRule(":root{}",e.cssRules.length);this.target=e.cssRules[t].style}}}class _l{constructor(e){this.store=new Map,this.target=null;const t=e.$fastController;this.style=document.createElement("style"),t.addStyles(this.style),zr.getNotifier(t).subscribe(this,"isConnected"),this.handleChange(t,"isConnected")}targetChanged(){if(null!==this.target)for(const[e,t]of this.store.entries())this.target.setProperty(e,t)}setProperty(e,t){this.store.set(e,t),Or.queueUpdate((()=>{null!==this.target&&this.target.setProperty(e,t)}))}removeProperty(e){this.store.delete(e),Or.queueUpdate((()=>{null!==this.target&&this.target.removeProperty(e)}))}handleChange(e,t){const{sheet:i}=this.style;if(i){const e=i.insertRule(":host{}",i.cssRules.length);this.target=i.cssRules[e].style}else this.target=null}}$l([Hr],_l.prototype,"target",void 0);class Il{constructor(e){this.target=e.style}setProperty(e,t){Or.queueUpdate((()=>this.target.setProperty(e,t)))}removeProperty(e){Or.queueUpdate((()=>this.target.removeProperty(e)))}}class Dl{setProperty(e,t){Dl.properties[e]=t;for(const i of Dl.roots.values())Al.getOrCreate(Dl.normalizeRoot(i)).setProperty(e,t)}removeProperty(e){delete Dl.properties[e];for(const t of Dl.roots.values())Al.getOrCreate(Dl.normalizeRoot(t)).removeProperty(e)}static registerRoot(e){const{roots:t}=Dl;if(!t.has(e)){t.add(e);const i=Al.getOrCreate(this.normalizeRoot(e));for(const e in Dl.properties)i.setProperty(e,Dl.properties[e])}}static unregisterRoot(e){const{roots:t}=Dl;if(t.has(e)){t.delete(e);const i=Al.getOrCreate(Dl.normalizeRoot(e));for(const e in Dl.properties)i.removeProperty(e)}}static normalizeRoot(e){return e===El?document:e}}Dl.roots=new Set,Dl.properties={};const Rl=new WeakMap,Pl=Or.supportsAdoptedStyleSheets?class extends Ll{constructor(e){super();const t=new CSSStyleSheet;this.target=t.cssRules[t.insertRule(":host{}")].style,e.$fastController.addStyles(_r.create([t]))}}:_l,Al=Object.freeze({getOrCreate(e){if(Rl.has(e))return Rl.get(e);let t;return e===El?t=new Dl:e instanceof Document?t=Or.supportsAdoptedStyleSheets?new Tl:new Ol:t=e instanceof Fs?new Pl(e):new Il(e),Rl.set(e,t),t}});class Fl extends yr{constructor(e){super(),this.subscribers=new WeakMap,this._appliedTo=new Set,this.name=e.name,null!==e.cssCustomPropertyName&&(this.cssCustomProperty=`--${e.cssCustomPropertyName}`,this.cssVar=`var(${this.cssCustomProperty})`),this.id=Fl.uniqueId(),Fl.tokensById.set(this.id,this)}get appliedTo(){return[...this._appliedTo]}static from(e){return new Fl({name:"string"==typeof e?e:e.name,cssCustomPropertyName:"string"==typeof e?e:void 0===e.cssCustomPropertyName?e.name:e.cssCustomPropertyName})}static isCSSDesignToken(e){return"string"==typeof e.cssCustomProperty}static isDerivedDesignTokenValue(e){return"function"==typeof e}static getTokenById(e){return Fl.tokensById.get(e)}getOrCreateSubscriberSet(e=this){return this.subscribers.get(e)||this.subscribers.set(e,new Set)&&this.subscribers.get(e)}createCSS(){return this.cssVar||""}getValueFor(e){const t=zl.getOrCreate(e).get(this);if(void 0!==t)return t;throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${e} or an ancestor of ${e}.`)}setValueFor(e,t){return this._appliedTo.add(e),t instanceof Fl&&(t=this.alias(t)),zl.getOrCreate(e).set(this,t),this}deleteValueFor(e){return this._appliedTo.delete(e),zl.existsFor(e)&&zl.getOrCreate(e).delete(this),this}withDefault(e){return this.setValueFor(El,e),this}subscribe(e,t){const i=this.getOrCreateSubscriberSet(t);t&&!zl.existsFor(t)&&zl.getOrCreate(t),i.has(e)||i.add(e)}unsubscribe(e,t){const i=this.subscribers.get(t||this);i&&i.has(e)&&i.delete(e)}notify(e){const t=Object.freeze({token:this,target:e});this.subscribers.has(this)&&this.subscribers.get(this).forEach((e=>e.handleChange(t))),this.subscribers.has(e)&&this.subscribers.get(e).forEach((e=>e.handleChange(t)))}alias(e){return t=>e.getValueFor(t)}}Fl.uniqueId=(()=>{let e=0;return()=>(e++,e.toString(16))})(),Fl.tokensById=new Map;class Bl{constructor(e,t,i){this.source=e,this.token=t,this.node=i,this.dependencies=new Set,this.observer=zr.binding(e,this,!1),this.observer.handleChange=this.observer.call,this.handleChange()}disconnect(){this.observer.disconnect()}handleChange(){this.node.store.set(this.token,this.observer.observe(this.node.target,Wr))}}class Ml{constructor(){this.values=new Map}set(e,t){this.values.get(e)!==t&&(this.values.set(e,t),zr.getNotifier(this).notify(e.id))}get(e){return zr.track(this,e.id),this.values.get(e)}delete(e){this.values.delete(e)}all(){return this.values.entries()}}const Vl=new WeakMap,jl=new WeakMap;class zl{constructor(e){this.target=e,this.store=new Ml,this.children=[],this.assignedValues=new Map,this.reflecting=new Set,this.bindingObservers=new Map,this.tokenValueChangeHandler={handleChange:(e,t)=>{const i=Fl.getTokenById(t);if(i&&(i.notify(this.target),Fl.isCSSDesignToken(i))){const t=this.parent,o=this.isReflecting(i);if(t){const n=t.get(i),r=e.get(i);n===r||o?n===r&&o&&this.stopReflectToCSS(i):this.reflectToCSS(i)}else o||this.reflectToCSS(i)}}},Vl.set(e,this),zr.getNotifier(this.store).subscribe(this.tokenValueChangeHandler),e instanceof Fs?e.$fastController.addBehaviors([this]):e.isConnected&&this.bind()}static getOrCreate(e){return Vl.get(e)||new zl(e)}static existsFor(e){return Vl.has(e)}static findParent(e){if(El!==e.target){let t=Nl(e.target);for(;null!==t;){if(Vl.has(t))return Vl.get(t);t=Nl(t)}return zl.getOrCreate(El)}return null}static findClosestAssignedNode(e,t){let i=t;do{if(i.has(e))return i;i=i.parent?i.parent:i.target!==El?zl.getOrCreate(El):null}while(null!==i);return null}get parent(){return jl.get(this)||null}has(e){return this.assignedValues.has(e)}get(e){const t=this.store.get(e);if(void 0!==t)return t;const i=this.getRaw(e);return void 0!==i?(this.hydrate(e,i),this.get(e)):void 0}getRaw(e){var t;return this.assignedValues.has(e)?this.assignedValues.get(e):null===(t=zl.findClosestAssignedNode(e,this))||void 0===t?void 0:t.getRaw(e)}set(e,t){Fl.isDerivedDesignTokenValue(this.assignedValues.get(e))&&this.tearDownBindingObserver(e),this.assignedValues.set(e,t),Fl.isDerivedDesignTokenValue(t)?this.setupBindingObserver(e,t):this.store.set(e,t)}delete(e){this.assignedValues.delete(e),this.tearDownBindingObserver(e);const t=this.getRaw(e);t?this.hydrate(e,t):this.store.delete(e)}bind(){const e=zl.findParent(this);e&&e.appendChild(this);for(const e of this.assignedValues.keys())e.notify(this.target)}unbind(){if(this.parent){jl.get(this).removeChild(this)}}appendChild(e){e.parent&&jl.get(e).removeChild(e);const t=this.children.filter((t=>e.contains(t)));jl.set(e,this),this.children.push(e),t.forEach((t=>e.appendChild(t))),zr.getNotifier(this.store).subscribe(e);for(const[t,i]of this.store.all())e.hydrate(t,this.bindingObservers.has(t)?this.getRaw(t):i)}removeChild(e){const t=this.children.indexOf(e);return-1!==t&&this.children.splice(t,1),zr.getNotifier(this.store).unsubscribe(e),e.parent===this&&jl.delete(e)}contains(e){return function(e,t){let i=t;for(;null!==i;){if(i===e)return!0;i=Nl(i)}return!1}(this.target,e.target)}reflectToCSS(e){this.isReflecting(e)||(this.reflecting.add(e),zl.cssCustomPropertyReflector.startReflection(e,this.target))}stopReflectToCSS(e){this.isReflecting(e)&&(this.reflecting.delete(e),zl.cssCustomPropertyReflector.stopReflection(e,this.target))}isReflecting(e){return this.reflecting.has(e)}handleChange(e,t){const i=Fl.getTokenById(t);i&&this.hydrate(i,this.getRaw(i))}hydrate(e,t){if(!this.has(e)){const i=this.bindingObservers.get(e);Fl.isDerivedDesignTokenValue(t)?i?i.source!==t&&(this.tearDownBindingObserver(e),this.setupBindingObserver(e,t)):this.setupBindingObserver(e,t):(i&&this.tearDownBindingObserver(e),this.store.set(e,t))}}setupBindingObserver(e,t){const i=new Bl(t,e,this);return this.bindingObservers.set(e,i),i}tearDownBindingObserver(e){return!!this.bindingObservers.has(e)&&(this.bindingObservers.get(e).disconnect(),this.bindingObservers.delete(e),!0)}}zl.cssCustomPropertyReflector=new class{startReflection(e,t){e.subscribe(this,t),this.handleChange({token:e,target:t})}stopReflection(e,t){e.unsubscribe(this,t),this.remove(e,t)}handleChange(e){const{token:t,target:i}=e;this.add(t,i)}add(e,t){Al.getOrCreate(t).setProperty(e.cssCustomProperty,this.resolveCSSValue(zl.getOrCreate(t).get(e)))}remove(e,t){Al.getOrCreate(t).removeProperty(e.cssCustomProperty)}resolveCSSValue(e){return e&&"function"==typeof e.createCSS?e.createCSS():e}},$l([Hr],zl.prototype,"children",void 0);const Hl=Object.freeze({create:function(e){return Fl.from(e)},notifyConnection:e=>!(!e.isConnected||!zl.existsFor(e))&&(zl.getOrCreate(e).bind(),!0),notifyDisconnection:e=>!(e.isConnected||!zl.existsFor(e))&&(zl.getOrCreate(e).unbind(),!0),registerRoot(e=El){Dl.registerRoot(e)},unregisterRoot(e=El){Dl.unregisterRoot(e)}});var Ul,ql,Kl;function Wl(e,t,i=18){const o=bl(e);let n=o.c+t*i;return n<0&&(n=0),ml(new ol(o.l,n,o.h))}function Gl(e,t){return e*t}function Xl(e,t){return new Ja(Gl(e.r,t.r),Gl(e.g,t.g),Gl(e.b,t.b),1)}function Yl(e,t){return Ka(e<.5?2*t*e:1-2*(1-t)*(1-e),0,1)}function Ql(e,t){return new Ja(Yl(e.r,t.r),Yl(e.g,t.g),Yl(e.b,t.b),1)}function Zl(e,t,i,o){if(isNaN(e)||e<=0)return i;if(e>=1)return o;switch(t){case Kl.HSL:return dl(function(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:new el(Qa(e,t.h,i.h),Ya(e,t.s,i.s),Ya(e,t.l,i.l))}(e,cl(i),cl(o)));case Kl.HSV:return function(e,t=1){const i=e.s*e.v,o=i*(1-Math.abs(e.h/60%2-1)),n=e.v-i;let r=0,s=0,a=0;return e.h<60?(r=i,s=o,a=0):e.h<120?(r=o,s=i,a=0):e.h<180?(r=0,s=i,a=o):e.h<240?(r=0,s=o,a=i):e.h<300?(r=o,s=0,a=i):e.h<360&&(r=i,s=0,a=o),new Ja(r+n,s+n,a+n,t)}(function(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:new tl(Qa(e,t.h,i.h),Ya(e,t.s,i.s),Ya(e,t.v,i.v))}(e,hl(i),hl(o)));case Kl.XYZ:return gl(function(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:new nl(Ya(e,t.x,i.x),Ya(e,t.y,i.y),Ya(e,t.z,i.z))}(e,pl(i),pl(o)));case Kl.LAB:return vl(function(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:new il(Ya(e,t.l,i.l),Ya(e,t.a,i.a),Ya(e,t.b,i.b))}(e,fl(i),fl(o)));case Kl.LCH:return ml(function(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:new ol(Ya(e,t.l,i.l),Ya(e,t.c,i.c),Qa(e,t.h,i.h))}(e,bl(i),bl(o)));default:return function(e,t,i){return isNaN(e)||e<=0?t:e>=1?i:new Ja(Ya(e,t.r,i.r),Ya(e,t.g,i.g),Ya(e,t.b,i.b),Ya(e,t.a,i.a))}(e,i,o)}}!function(e){e["ltr"]="ltr",e["rtl"]="rtl"}(Ul||(Ul={})),function(e){e[e["Burn"]=0]="Burn",e[e["Color"]=1]="Color",e[e["Darken"]=2]="Darken",e[e["Dodge"]=3]="Dodge",e[e["Lighten"]=4]="Lighten",e[e["Multiply"]=5]="Multiply",e[e["Overlay"]=6]="Overlay",e[e["Screen"]=7]="Screen"}(ql||(ql={})),function(e){e[e["RGB"]=0]="RGB",e[e["HSL"]=1]="HSL",e[e["HSV"]=2]="HSV",e[e["XYZ"]=3]="XYZ",e[e["LAB"]=4]="LAB",e[e["LCH"]=5]="LCH"}(Kl||(Kl={}));class Jl{constructor(e){if(null==e||0===e.length)throw new Error("The stops argument must be non-empty");this.stops=this.sortColorScaleStops(e)}static createBalancedColorScale(e){if(null==e||0===e.length)throw new Error("The colors argument must be non-empty");const t=new Array(e.length);for(let i=0;i=1)return this.stops[this.stops.length-1].color;let i=0;for(let t=0;t=this.stops.length&&(o=this.stops.length-1);return Zl((e-this.stops[i].position)*(1/(this.stops[o].position-this.stops[i].position)),t,this.stops[i].color,this.stops[o].color)}trim(e,t,i=Kl.RGB){if(e<0||t>1||t=e&&this.stops[i].position<=t&&o.push(this.stops[i]);if(0===o.length)return new Jl([{color:this.getColor(e),position:e},{color:this.getColor(t),position:t}]);o[0].position!==e&&o.unshift({color:this.getColor(e),position:e}),o[o.length-1].position!==t&&o.push({color:this.getColor(t),position:t});const n=t-e,r=new Array(o.length);for(let t=0;t=1&&(e=1);const s=this.getColor(e,o),a=i?0:1;if(ll(s,this.getColor(a,o))<=t)return a;let l=i?0:e,c=i?e:0,d=a,h=0;for(;h<=r;){d=Math.abs(c-l)/2+l;const e=ll(s,this.getColor(d,o));if(Math.abs(e-t)<=n)return d;e>t?i?l=d:c=d:i?c=d:l=d,h++}return d}clone(){const e=new Array(this.stops.length);for(let t=0;t{const i=e.position,o=t.position;return io?1:0}))}}const ec=/^#((?:[0-9a-f]{6}|[0-9a-f]{3}))$/i;function tc(e){const t=ec.exec(e);if(null===t)return null;let i=t[1];if(3===i.length){const e=i.charAt(0),t=i.charAt(1),o=i.charAt(2);i=e.concat(e,t,t,o,o)}const o=parseInt(i,16);return isNaN(o)?null:new Ja(Wa((16711680&o)>>>16,0,255),Wa((65280&o)>>>8,0,255),Wa(255&o,0,255),1)}class ic{constructor(e){this.config=Object.assign({},ic.defaultPaletteConfig,e),this.palette=[],this.updatePaletteColors()}updatePaletteGenerationValues(e){let t=!1;for(const i in e)this.config[i]&&(this.config[i].equalValue?this.config[i].equalValue(e[i])||(this.config[i]=e[i],t=!0):e[i]!==this.config[i]&&(this.config[i]=e[i],t=!0));return t&&this.updatePaletteColors(),t}updatePaletteColors(){const e=this.generatePaletteColorScale();for(let t=0;t=this.config.saturationAdjustmentCutoff&&(i=Wl(i,this.config.saturationLight),o=Wl(o,this.config.saturationDark)),0!==this.config.multiplyLight){const e=Xl(this.config.baseColor,i);i=Zl(this.config.multiplyLight,this.config.interpolationMode,i,e)}if(0!==this.config.multiplyDark){const e=Xl(this.config.baseColor,o);o=Zl(this.config.multiplyDark,this.config.interpolationMode,o,e)}if(0!==this.config.overlayLight){const e=Ql(this.config.baseColor,i);i=Zl(this.config.overlayLight,this.config.interpolationMode,i,e)}if(0!==this.config.overlayDark){const e=Ql(this.config.baseColor,o);o=Zl(this.config.overlayDark,this.config.interpolationMode,o,e)}return this.config.baseScalePosition?this.config.baseScalePosition<=0?new Jl([{position:0,color:this.config.baseColor},{position:1,color:o.clamp()}]):this.config.baseScalePosition>=1?new Jl([{position:0,color:i.clamp()},{position:1,color:this.config.baseColor}]):new Jl([{position:0,color:i.clamp()},{position:this.config.baseScalePosition,color:this.config.baseColor},{position:1,color:o.clamp()}]):new Jl([{position:0,color:i.clamp()},{position:.5,color:this.config.baseColor},{position:1,color:o.clamp()}])}}ic.defaultPaletteConfig={baseColor:tc("#808080"),steps:11,interpolationMode:Kl.RGB,scaleColorLight:new Ja(1,1,1,1),scaleColorDark:new Ja(0,0,0,1),clipLight:.185,clipDark:.16,saturationAdjustmentCutoff:.05,saturationLight:.35,saturationDark:1.25,overlayLight:0,overlayDark:.25,multiplyLight:0,multiplyDark:0,baseScalePosition:.5},ic.greyscalePaletteConfig={baseColor:tc("#808080"),steps:11,interpolationMode:Kl.RGB,scaleColorLight:new Ja(1,1,1,1),scaleColorDark:new Ja(0,0,0,1),clipLight:0,clipDark:0,saturationAdjustmentCutoff:0,saturationLight:0,saturationDark:0,overlayLight:0,overlayDark:0,multiplyLight:0,multiplyDark:0,baseScalePosition:.5};ic.defaultPaletteConfig.scaleColorLight,ic.defaultPaletteConfig.scaleColorDark;class oc{constructor(e){this.palette=[],this.config=Object.assign({},oc.defaultPaletteConfig,e),this.regenPalettes()}regenPalettes(){let e=this.config.steps;(isNaN(e)||e<3)&&(e=3);const t=.14,i=new Ja(t,t,t,1),o=new ic(Object.assign(Object.assign({},ic.greyscalePaletteConfig),{baseColor:i,baseScalePosition:100*(1-t)/94,steps:e})).palette,n=(rl(this.config.baseColor)+cl(this.config.baseColor).l)/2,r=this.matchRelativeLuminanceIndex(n,o)/(e-1),s=this.matchRelativeLuminanceIndex(t,o)/(e-1),a=cl(this.config.baseColor),l=dl(el.fromObject({h:a.h,s:a.s,l:t})),c=dl(el.fromObject({h:a.h,s:a.s,l:.06})),d=new Array(5);d[0]={position:0,color:new Ja(1,1,1,1)},d[1]={position:r,color:this.config.baseColor},d[2]={position:s,color:l},d[3]={position:.99,color:c},d[4]={position:1,color:new Ja(0,0,0,1)};const h=new Jl(d);this.palette=new Array(e);for(let t=0;t"",contrast:()=>0,relativeLuminance:0};for(const i in t)if(typeof t[i]!=typeof e[i])return!1;return!0}(e)?lc.from(e):lc.from(wl.create(e.r,e.g,e.b))}});class lc{constructor(e,t){this.closestIndexCache=new Map,this.source=e,this.swatches=t,this.reversedSwatches=Object.freeze([...this.swatches].reverse()),this.lastIndex=this.swatches.length-1}colorContrast(e,t,i,o){void 0===i&&(i=this.closestIndexOf(e));let n=this.swatches;const r=this.lastIndex;let s=i;void 0===o&&(o=sc(e));return-1===o&&(n=this.reversedSwatches,s=r-s),nc(n,(i=>yl(e,i)>=t),s,r)}get(e){return this.swatches[e]||this.swatches[Ka(e,0,this.lastIndex)]}closestIndexOf(e){if(this.closestIndexCache.has(e.relativeLuminance))return this.closestIndexCache.get(e.relativeLuminance);let t=this.swatches.indexOf(e);if(-1!==t)return this.closestIndexCache.set(e.relativeLuminance,t),t;const i=this.swatches.reduce(((t,i)=>Math.abs(i.relativeLuminance-e.relativeLuminance){const t=tc(e.toStringHexRGB());return wl.create(t.r,t.g,t.b)}))))}}const cc=wl.create(1,1,1),dc=wl.create(0,0,0),hc=wl.from(tc("#808080")),uc=wl.from(tc("#DA1A5F"));function pc(e,t,i,o,n,r){return Math.max(e.closestIndexOf(kl(t))+i,o,n,r)}const{create:gc}=Hl;function fc(e){return Hl.create({name:e,cssCustomPropertyName:null})}const vc=gc("body-font").withDefault('aktiv-grotesk, "Segoe UI", Arial, Helvetica, sans-serif'),bc=gc("base-height-multiplier").withDefault(10),mc=gc("base-horizontal-spacing-multiplier").withDefault(3),yc=gc("base-layer-luminance").withDefault(Cl),wc=gc("control-corner-radius").withDefault(4),xc=gc("density").withDefault(0),kc=gc("design-unit").withDefault(4),Sc=gc("direction").withDefault(Ul.ltr),Cc=gc("disabled-opacity").withDefault(.3),$c=gc("stroke-width").withDefault(1),Nc=gc("focus-stroke-width").withDefault(2),Ec=gc("type-ramp-base-font-size").withDefault("14px"),Lc=gc("type-ramp-base-line-height").withDefault("20px"),Tc=gc("type-ramp-minus-1-font-size").withDefault("12px"),Oc=gc("type-ramp-minus-1-line-height").withDefault("16px"),_c=gc("type-ramp-minus-2-font-size").withDefault("10px"),Ic=gc("type-ramp-minus-2-line-height").withDefault("16px"),Dc=gc("type-ramp-plus-1-font-size").withDefault("16px"),Rc=gc("type-ramp-plus-1-line-height").withDefault("24px"),Pc=gc("type-ramp-plus-2-font-size").withDefault("20px"),Ac=gc("type-ramp-plus-2-line-height").withDefault("28px"),Fc=gc("type-ramp-plus-3-font-size").withDefault("28px"),Bc=gc("type-ramp-plus-3-line-height").withDefault("36px"),Mc=gc("type-ramp-plus-4-font-size").withDefault("34px"),Vc=gc("type-ramp-plus-4-line-height").withDefault("44px"),jc=gc("type-ramp-plus-5-font-size").withDefault("46px"),zc=gc("type-ramp-plus-5-line-height").withDefault("56px"),Hc=gc("type-ramp-plus-6-font-size").withDefault("60px"),Uc=gc("type-ramp-plus-6-line-height").withDefault("72px"),qc=fc("accent-fill-rest-delta").withDefault(0),Kc=fc("accent-fill-hover-delta").withDefault(4),Wc=fc("accent-fill-active-delta").withDefault(-5),Gc=fc("accent-fill-focus-delta").withDefault(0),Xc=fc("accent-foreground-rest-delta").withDefault(0),Yc=fc("accent-foreground-hover-delta").withDefault(6),Qc=fc("accent-foreground-active-delta").withDefault(-4),Zc=fc("accent-foreground-focus-delta").withDefault(0),Jc=fc("neutral-fill-rest-delta").withDefault(7),ed=fc("neutral-fill-hover-delta").withDefault(10),td=fc("neutral-fill-active-delta").withDefault(5),id=fc("neutral-fill-focus-delta").withDefault(0),od=fc("neutral-fill-input-rest-delta").withDefault(0),nd=fc("neutral-fill-input-hover-delta").withDefault(0),rd=fc("neutral-fill-input-active-delta").withDefault(0),sd=fc("neutral-fill-input-focus-delta").withDefault(0),ad=fc("neutral-fill-stealth-rest-delta").withDefault(0),ld=fc("neutral-fill-stealth-hover-delta").withDefault(5),cd=fc("neutral-fill-stealth-active-delta").withDefault(3),dd=fc("neutral-fill-stealth-focus-delta").withDefault(0),hd=fc("neutral-fill-strong-rest-delta").withDefault(0),ud=fc("neutral-fill-strong-hover-delta").withDefault(8),pd=fc("neutral-fill-strong-active-delta").withDefault(-5),gd=fc("neutral-fill-strong-focus-delta").withDefault(0),fd=fc("neutral-fill-layer-rest-delta").withDefault(3),vd=fc("neutral-stroke-rest-delta").withDefault(25),bd=fc("neutral-stroke-hover-delta").withDefault(40),md=fc("neutral-stroke-active-delta").withDefault(16),yd=fc("neutral-stroke-focus-delta").withDefault(25),wd=fc("neutral-stroke-divider-rest-delta").withDefault(8),xd=gc("neutral-color").withDefault(hc),kd=fc("neutral-palette").withDefault((e=>ac.from(xd.getValueFor(e)))),Sd=gc("accent-color").withDefault(uc),Cd=fc("accent-palette").withDefault((e=>ac.from(Sd.getValueFor(e)))),$d=fc("neutral-layer-card-container-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=yc.getValueFor(e),o=fd.getValueFor(e),t.get(t.closestIndexOf(kl(i))+o);var t,i,o}}),Nd=(gc("neutral-layer-card-container").withDefault((e=>$d.getValueFor(e).evaluate(e))),fc("neutral-layer-floating-recipe").withDefault({evaluate:e=>function(e,t,i){const o=e.closestIndexOf(kl(t))-i;return e.get(o-i)}(kd.getValueFor(e),yc.getValueFor(e),fd.getValueFor(e))})),Ed=gc("neutral-layer-floating").withDefault((e=>Nd.getValueFor(e).evaluate(e))),Ld=fc("neutral-layer-1-recipe").withDefault({evaluate:e=>function(e,t){return e.get(e.closestIndexOf(kl(t)))}(kd.getValueFor(e),yc.getValueFor(e))}),Td=gc("neutral-layer-1").withDefault((e=>Ld.getValueFor(e).evaluate(e))),Od=fc("neutral-layer-2-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=yc.getValueFor(e),o=fd.getValueFor(e),n=Jc.getValueFor(e),r=ed.getValueFor(e),s=td.getValueFor(e),t.get(pc(t,i,o,n,r,s));var t,i,o,n,r,s}}),_d=(gc("neutral-layer-2").withDefault((e=>Od.getValueFor(e).evaluate(e))),fc("neutral-layer-3-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=yc.getValueFor(e),o=fd.getValueFor(e),n=Jc.getValueFor(e),r=ed.getValueFor(e),s=td.getValueFor(e),t.get(pc(t,i,o,n,r,s)+o);var t,i,o,n,r,s}})),Id=gc("neutral-layer-3").withDefault((e=>_d.getValueFor(e).evaluate(e))),Dd=fc("neutral-layer-4-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=yc.getValueFor(e),o=fd.getValueFor(e),n=Jc.getValueFor(e),r=ed.getValueFor(e),s=td.getValueFor(e),t.get(pc(t,i,o,n,r,s)+2*o);var t,i,o,n,r,s}}),Rd=gc("neutral-layer-4").withDefault((e=>Dd.getValueFor(e).evaluate(e))),Pd=gc("fill-color").withDefault((e=>Td.getValueFor(e)));var Ad;!function(e){e[e["normal"]=4.5]="normal",e[e["large"]=7]="large"}(Ad||(Ad={}));const Fd=gc({name:"accent-fill-recipe",cssCustomPropertyName:null}).withDefault({evaluate:(e,t)=>function(e,t,i,o,n,r,s,a,l){const c=e.source,d=t.closestIndexOf(i)>=Math.max(s,a,l)?-1:1,h=e.closestIndexOf(c),u=h+-1*d*o,p=u+d*n,g=u+d*r;return{rest:e.get(u),hover:e.get(h),active:e.get(p),focus:e.get(g)}}(Cd.getValueFor(e),kd.getValueFor(e),t||Pd.getValueFor(e),Kc.getValueFor(e),Wc.getValueFor(e),Gc.getValueFor(e),Jc.getValueFor(e),ed.getValueFor(e),td.getValueFor(e))}),Bd=gc("accent-fill-rest").withDefault((e=>Fd.getValueFor(e).evaluate(e).rest)),Md=gc("accent-fill-hover").withDefault((e=>Fd.getValueFor(e).evaluate(e).hover)),Vd=gc("accent-fill-active").withDefault((e=>Fd.getValueFor(e).evaluate(e).active)),jd=gc("accent-fill-focus").withDefault((e=>Fd.getValueFor(e).evaluate(e).focus)),zd=e=>(t,i)=>function(e,t){return e.contrast(cc)>=t?cc:dc}(i||Bd.getValueFor(t),e),Hd=fc("foreground-on-accent-recipe").withDefault({evaluate:(e,t)=>zd(Ad.normal)(e,t)}),Ud=gc("foreground-on-accent-rest").withDefault((e=>Hd.getValueFor(e).evaluate(e,Bd.getValueFor(e)))),qd=gc("foreground-on-accent-hover").withDefault((e=>Hd.getValueFor(e).evaluate(e,Md.getValueFor(e)))),Kd=gc("foreground-on-accent-active").withDefault((e=>Hd.getValueFor(e).evaluate(e,Vd.getValueFor(e)))),Wd=gc("foreground-on-accent-focus").withDefault((e=>Hd.getValueFor(e).evaluate(e,jd.getValueFor(e)))),Gd=fc("foreground-on-accent-large-recipe").withDefault({evaluate:(e,t)=>zd(Ad.large)(e,t)}),Xd=(gc("foreground-on-accent-rest-large").withDefault((e=>Gd.getValueFor(e).evaluate(e,Bd.getValueFor(e)))),gc("foreground-on-accent-hover-large").withDefault((e=>Gd.getValueFor(e).evaluate(e,Md.getValueFor(e)))),gc("foreground-on-accent-active-large").withDefault((e=>Gd.getValueFor(e).evaluate(e,Vd.getValueFor(e)))),gc("foreground-on-accent-focus-large").withDefault((e=>Gd.getValueFor(e).evaluate(e,jd.getValueFor(e)))),e=>(t,i)=>function(e,t,i,o,n,r,s){const a=e.source,l=e.closestIndexOf(a),c=sc(t),d=l+(1===c?Math.min(o,n):Math.max(c*o,c*n)),h=e.colorContrast(t,i,d,c),u=e.closestIndexOf(h),p=u+c*Math.abs(o-n);let g,f;return(1===c?oc*n)?(g=u,f=p):(g=p,f=u),{rest:e.get(g),hover:e.get(f),active:e.get(g+c*r),focus:e.get(g+c*s)}}(Cd.getValueFor(t),i||Pd.getValueFor(t),e,Xc.getValueFor(t),Yc.getValueFor(t),Qc.getValueFor(t),Zc.getValueFor(t))),Yd=gc({name:"accent-foreground-recipe",cssCustomPropertyName:null}).withDefault({evaluate:(e,t)=>Xd(Ad.normal)(e,t)}),Qd=gc("accent-foreground-rest").withDefault((e=>Yd.getValueFor(e).evaluate(e).rest)),Zd=gc("accent-foreground-hover").withDefault((e=>Yd.getValueFor(e).evaluate(e).hover)),Jd=gc("accent-foreground-active").withDefault((e=>Yd.getValueFor(e).evaluate(e).active)),eh=(gc("accent-foreground-focus").withDefault((e=>Yd.getValueFor(e).evaluate(e).focus)),gc({name:"neutral-fill-recipe",cssCustomPropertyName:null}).withDefault({evaluate:(e,t)=>function(e,t,i,o,n,r){const s=e.closestIndexOf(t),a=s>=Math.max(i,o,n,r)?-1:1;return{rest:e.get(s+a*i),hover:e.get(s+a*o),active:e.get(s+a*n),focus:e.get(s+a*r)}}(kd.getValueFor(e),t||Pd.getValueFor(e),Jc.getValueFor(e),ed.getValueFor(e),td.getValueFor(e),id.getValueFor(e))})),th=gc("neutral-fill-rest").withDefault((e=>eh.getValueFor(e).evaluate(e).rest)),ih=gc("neutral-fill-hover").withDefault((e=>eh.getValueFor(e).evaluate(e).hover)),oh=gc("neutral-fill-active").withDefault((e=>eh.getValueFor(e).evaluate(e).active)),nh=(gc("neutral-fill-focus").withDefault((e=>eh.getValueFor(e).evaluate(e).focus)),gc({name:"neutral-fill-input-recipe",cssCustomPropertyName:null}).withDefault({evaluate:(e,t)=>function(e,t,i,o,n,r){const s=sc(t),a=e.closestIndexOf(t);return{rest:e.get(a-s*i),hover:e.get(a-s*o),active:e.get(a-s*n),focus:e.get(a-s*r)}}(kd.getValueFor(e),t||Pd.getValueFor(e),od.getValueFor(e),nd.getValueFor(e),rd.getValueFor(e),sd.getValueFor(e))})),rh=gc("neutral-fill-input-rest").withDefault((e=>nh.getValueFor(e).evaluate(e).rest)),sh=gc("neutral-fill-input-hover").withDefault((e=>nh.getValueFor(e).evaluate(e).hover)),ah=gc("neutral-fill-input-active").withDefault((e=>nh.getValueFor(e).evaluate(e).active)),lh=(gc("neutral-fill-input-focus").withDefault((e=>nh.getValueFor(e).evaluate(e).focus)),gc({name:"neutral-fill-stealth-recipe",cssCustomPropertyName:null}).withDefault({evaluate:(e,t)=>function(e,t,i,o,n,r,s,a,l,c){const d=Math.max(i,o,n,r,s,a,l,c),h=e.closestIndexOf(t),u=h>=d?-1:1;return{rest:e.get(h+u*i),hover:e.get(h+u*o),active:e.get(h+u*n),focus:e.get(h+u*r)}}(kd.getValueFor(e),t||Pd.getValueFor(e),ad.getValueFor(e),ld.getValueFor(e),cd.getValueFor(e),dd.getValueFor(e),Jc.getValueFor(e),ed.getValueFor(e),td.getValueFor(e),id.getValueFor(e))})),ch=gc("neutral-fill-stealth-rest").withDefault((e=>lh.getValueFor(e).evaluate(e).rest)),dh=gc("neutral-fill-stealth-hover").withDefault((e=>lh.getValueFor(e).evaluate(e).hover)),hh=gc("neutral-fill-stealth-active").withDefault((e=>lh.getValueFor(e).evaluate(e).active)),uh=gc("neutral-fill-stealth-focus").withDefault((e=>lh.getValueFor(e).evaluate(e).focus)),ph=gc({name:"neutral-fill-strong-recipe",cssCustomPropertyName:null}).withDefault({evaluate:(e,t)=>function(e,t,i,o,n,r){const s=sc(t),a=e.closestIndexOf(e.colorContrast(t,4.5)),l=a+s*Math.abs(i-o);let c,d;return(1===s?is*o)?(c=a,d=l):(c=l,d=a),{rest:e.get(c),hover:e.get(d),active:e.get(c+s*n),focus:e.get(c+s*r)}}(kd.getValueFor(e),t||Pd.getValueFor(e),hd.getValueFor(e),ud.getValueFor(e),pd.getValueFor(e),gd.getValueFor(e))}),gh=(gc("neutral-fill-strong-rest").withDefault((e=>ph.getValueFor(e).evaluate(e).rest)),gc("neutral-fill-strong-hover").withDefault((e=>ph.getValueFor(e).evaluate(e).hover)),gc("neutral-fill-strong-active").withDefault((e=>ph.getValueFor(e).evaluate(e).active)),gc("neutral-fill-strong-focus").withDefault((e=>ph.getValueFor(e).evaluate(e).focus)),fc("neutral-fill-layer-recipe").withDefault({evaluate:(e,t)=>function(e,t,i){const o=e.closestIndexOf(t);return e.get(o-(ogh.getValueFor(e).evaluate(e))),fc("focus-stroke-outer-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=Pd.getValueFor(e),t.colorContrast(i,3.5);var t,i}})),vh=gc("focus-stroke-outer").withDefault((e=>fh.getValueFor(e).evaluate(e))),bh=fc("focus-stroke-inner-recipe").withDefault({evaluate:e=>{return t=Cd.getValueFor(e),i=Pd.getValueFor(e),o=vh.getValueFor(e),t.colorContrast(o,3.5,t.closestIndexOf(t.source),-1*sc(i));var t,i,o}}),mh=gc("focus-stroke-inner").withDefault((e=>bh.getValueFor(e).evaluate(e))),yh=fc("neutral-foreground-hint-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=Pd.getValueFor(e),t.colorContrast(i,4.5);var t,i}}),wh=gc("neutral-foreground-hint").withDefault((e=>yh.getValueFor(e).evaluate(e))),xh=fc("neutral-foreground-recipe").withDefault({evaluate:e=>{return t=kd.getValueFor(e),i=Pd.getValueFor(e),t.colorContrast(i,14);var t,i}}),kh=gc("neutral-foreground-rest").withDefault((e=>xh.getValueFor(e).evaluate(e))),Sh=gc({name:"neutral-stroke-recipe",cssCustomPropertyName:null}).withDefault({evaluate:e=>function(e,t,i,o,n,r){const s=e.closestIndexOf(t),a=sc(t),l=s+a*i,c=l+a*(o-i),d=l+a*(n-i),h=l+a*(r-i);return{rest:e.get(l),hover:e.get(c),active:e.get(d),focus:e.get(h)}}(kd.getValueFor(e),Pd.getValueFor(e),vd.getValueFor(e),bd.getValueFor(e),md.getValueFor(e),yd.getValueFor(e))}),Ch=gc("neutral-stroke-rest").withDefault((e=>Sh.getValueFor(e).evaluate(e).rest)),$h=gc("neutral-stroke-hover").withDefault((e=>Sh.getValueFor(e).evaluate(e).hover)),Nh=gc("neutral-stroke-active").withDefault((e=>Sh.getValueFor(e).evaluate(e).active)),Eh=(gc("neutral-stroke-focus").withDefault((e=>Sh.getValueFor(e).evaluate(e).focus)),fc("neutral-stroke-divider-recipe").withDefault({evaluate:(e,t)=>function(e,t,i){return e.get(e.closestIndexOf(t)+sc(t)*i)}(kd.getValueFor(e),t||Pd.getValueFor(e),wd.getValueFor(e))})),Lh=gc("neutral-stroke-divider-rest").withDefault((e=>Eh.getValueFor(e).evaluate(e))),Th=Hl.create({name:"height-number",cssCustomPropertyName:null}).withDefault((e=>(bc.getValueFor(e)+xc.getValueFor(e))*kc.getValueFor(e)));var Oh=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const _h={name:"",neutralBaseColor:"",accentColor:"#007ACC",baseLayerLuminance:Cl,backgroundToken:null,useThemeColors:!0,selectionColor:"",textHighlightColor:"",tagTextColor:""};function Ih(){return Fh}class Dh{}Oh([Hr],Dh.prototype,"name",void 0),Oh([Hr],Dh.prototype,"neutralBaseColor",void 0),Oh([Hr],Dh.prototype,"accentColor",void 0),Oh([Hr],Dh.prototype,"baseLayerLuminance",void 0),Oh([Hr],Dh.prototype,"backgroundToken",void 0),Oh([Hr],Dh.prototype,"useThemeColors",void 0),Oh([Hr],Dh.prototype,"selectionColor",void 0),Oh([Hr],Dh.prototype,"textHighlightColor",void 0),Oh([Hr],Dh.prototype,"tagTextColor",void 0);const Rh={..._h,name:"Light",neutralBaseColor:"#F5F5F5",baseLayerLuminance:Sl,backgroundToken:Id},Ph={..._h,name:"Dark",neutralBaseColor:"#252526",baseLayerLuminance:Cl,backgroundToken:Rd},Ah={..._h,name:"Blue",neutralBaseColor:"#CCD5F0",accentColor:"#F5CC84",baseLayerLuminance:Sl,backgroundToken:Rd},Fh=new Dh;function Bh(e){"Light"===e.themeName?Object.assign(Fh,Rh):"Blue"===e.themeName?Object.assign(Fh,Ah):Object.assign(Fh,Ph),Object.assign(Fh,e)}function Mh(e){return`${e.toLowerCase()}:presentation`}Bh({themeName:"Dark"});const Vh=new Map,jh=Object.freeze({define(e,t,i){const o=Mh(e);void 0===Vh.get(o)?Vh.set(o,t):Vh.set(o,!1),i.register(pa.instance(o,t))},forTag(e,t){const i=Mh(e),o=Vh.get(i);if(!1===o){return Ws.findResponsibleContainer(t).get(i)}return o||null}});class zh{constructor(e,t){this.template=e||null,this.styles=void 0===t?null:Array.isArray(t)?_r.create(t):t instanceof _r?t:_r.create([t])}applyTo(e){const t=e.$fastController;null===t.template&&(t.template=this.template),null===t.styles&&(t.styles=this.styles)}}class Hh extends Fs{constructor(){super(...arguments),this._presentation=void 0}get $presentation(){return void 0===this._presentation&&(this._presentation=jh.forTag(this.tagName,this)),this._presentation}templateChanged(){void 0!==this.template&&(this.$fastController.template=this.template)}stylesChanged(){void 0!==this.styles&&(this.$fastController.styles=this.styles)}connectedCallback(){null!==this.$presentation&&this.$presentation.applyTo(this),super.connectedCallback()}static compose(e){return(t={})=>new qh(this===Hh?class extends Hh{}:this,e,t)}}function Uh(e,t,i){return"function"==typeof e?e(t,i):e}$l([Hr],Hh.prototype,"template",void 0),$l([Hr],Hh.prototype,"styles",void 0);class qh{constructor(e,t,i){this.type=e,this.elementDefinition=t,this.overrideDefinition=i,this.definition=Object.assign(Object.assign({},this.elementDefinition),this.overrideDefinition)}register(e,t){const i=this.definition,o=this.overrideDefinition,n=`${i.prefix||t.elementPrefix}-${i.baseName}`;t.tryDefineElement({name:n,type:this.type,baseClass:this.elementDefinition.baseClass,callback:e=>{const t=new zh(Uh(i.template,e,i),Uh(i.styles,e,i));e.definePresentation(t);let n=Uh(i.shadowOptions,e,i);e.shadowRootMode&&(n?o.shadowOptions||(n.mode=e.shadowRootMode):null!==n&&(n={mode:e.shadowRootMode})),e.defineElement({elementOptions:Uh(i.elementOptions,e,i),shadowOptions:n,attributes:Uh(i.attributes,e,i)})}})}}const Kh=Object.freeze({definitionCallbackOnly:null,ignoreDuplicate:Symbol()}),Wh=new Map,Gh=new Map;let Xh=null;const Yh=Ws.createInterface((e=>e.cachedCallback((e=>(null===Xh&&(Xh=new Zh(null,e)),Xh))))),Qh=Object.freeze({tagFor:e=>Gh.get(e),responsibleFor(e){const t=e.$$designSystem$$;if(t)return t;return Ws.findResponsibleContainer(e).get(Yh)},getOrCreate(e){if(!e)return null===Xh&&(Xh=Ws.getOrCreateDOMContainer().get(Yh)),Xh;const t=e.$$designSystem$$;if(t)return t;const i=Ws.getOrCreateDOMContainer(e);if(i.has(Yh,!1))return i.get(Yh);{const t=new Zh(e,i);return i.register(pa.instance(Yh,t)),t}}});class Zh{constructor(e,t){this.owner=e,this.container=t,this.designTokensInitialized=!1,this.prefix="fast",this.shadowRootMode=void 0,this.disambiguate=()=>Kh.definitionCallbackOnly,null!==e&&(e.$$designSystem$$=this)}withPrefix(e){return this.prefix=e,this}withShadowRootMode(e){return this.shadowRootMode=e,this}withElementDisambiguation(e){return this.disambiguate=e,this}withDesignTokenRoot(e){return this.designTokenRoot=e,this}register(...e){const t=this.container,i=[],o=this.disambiguate,n=this.shadowRootMode,r={elementPrefix:this.prefix,tryDefineElement(e,r,s){const a=function(e,t,i){return"string"==typeof e?{name:e,type:t,callback:i}:e}(e,r,s),{name:l,callback:c,baseClass:d}=a;let{type:h}=a,u=l,p=Wh.get(u),g=!0;for(;p;){const e=o(u,h,p);switch(e){case Kh.ignoreDuplicate:return;case Kh.definitionCallbackOnly:g=!1,p=void 0;break;default:u=e,p=Wh.get(u)}}g&&((Gh.has(h)||h===Hh)&&(h=class extends h{}),Wh.set(u,h),Gh.set(h,u),d&&Gh.set(d,u)),i.push(new Jh(t,u,h,n,c,g))}};this.designTokensInitialized||(this.designTokensInitialized=!0,null!==this.designTokenRoot&&Hl.registerRoot(this.designTokenRoot)),t.registerWithContext(r,...e);for(const e of i)e.callback(e),e.willDefine&&null!==e.definition&&e.definition.define();return this}}class Jh{constructor(e,t,i,o,n,r){this.container=e,this.name=t,this.type=i,this.shadowRootMode=o,this.callback=n,this.willDefine=r,this.definition=null}definePresentation(e){jh.define(this.name,e,this.container)}defineElement(e){this.definition=new _s(this.type,Object.assign(Object.assign({},e),{name:this.name}))}tagFor(e){return Qh.tagFor(e)}}const eu="resize",tu="scroll",iu=e=>{const t=e.closest("[dir]");return null!==t&&"rtl"===t.dir?Ul.rtl:Ul.ltr};class ou extends Hh{constructor(){super(...arguments),this.anchor="",this.viewport="",this.horizontalPositioningMode="uncontrolled",this.horizontalDefaultPosition="unset",this.horizontalViewportLock=!1,this.horizontalInset=!1,this.horizontalScaling="content",this.verticalPositioningMode="uncontrolled",this.verticalDefaultPosition="unset",this.verticalViewportLock=!1,this.verticalInset=!1,this.verticalScaling="content",this.fixedPlacement=!1,this.autoUpdateMode="anchor",this.anchorElement=null,this.viewportElement=null,this.initialLayoutComplete=!1,this.resizeDetector=null,this.baseHorizontalOffset=0,this.baseVerticalOffset=0,this.pendingPositioningUpdate=!1,this.pendingReset=!1,this.currentDirection=Ul.ltr,this.regionVisible=!1,this.forceUpdate=!1,this.updateThreshold=.5,this.update=()=>{this.pendingPositioningUpdate||this.requestPositionUpdates()},this.startObservers=()=>{this.stopObservers(),null!==this.anchorElement&&(this.requestPositionUpdates(),null!==this.resizeDetector&&(this.resizeDetector.observe(this.anchorElement),this.resizeDetector.observe(this)))},this.requestPositionUpdates=()=>{null===this.anchorElement||this.pendingPositioningUpdate||(ou.intersectionService.requestPosition(this,this.handleIntersection),ou.intersectionService.requestPosition(this.anchorElement,this.handleIntersection),null!==this.viewportElement&&ou.intersectionService.requestPosition(this.viewportElement,this.handleIntersection),this.pendingPositioningUpdate=!0)},this.stopObservers=()=>{this.pendingPositioningUpdate&&(this.pendingPositioningUpdate=!1,ou.intersectionService.cancelRequestPosition(this,this.handleIntersection),null!==this.anchorElement&&ou.intersectionService.cancelRequestPosition(this.anchorElement,this.handleIntersection),null!==this.viewportElement&&ou.intersectionService.cancelRequestPosition(this.viewportElement,this.handleIntersection)),null!==this.resizeDetector&&this.resizeDetector.disconnect()},this.getViewport=()=>"string"!=typeof this.viewport||""===this.viewport?document.documentElement:document.getElementById(this.viewport),this.getAnchor=()=>document.getElementById(this.anchor),this.handleIntersection=e=>{this.pendingPositioningUpdate&&(this.pendingPositioningUpdate=!1,this.applyIntersectionEntries(e)&&this.updateLayout())},this.applyIntersectionEntries=e=>{const t=e.find((e=>e.target===this)),i=e.find((e=>e.target===this.anchorElement)),o=e.find((e=>e.target===this.viewportElement));return void 0!==t&&void 0!==o&&void 0!==i&&(!!(!this.regionVisible||this.forceUpdate||void 0===this.regionRect||void 0===this.anchorRect||void 0===this.viewportRect||this.isRectDifferent(this.anchorRect,i.boundingClientRect)||this.isRectDifferent(this.viewportRect,o.boundingClientRect)||this.isRectDifferent(this.regionRect,t.boundingClientRect))&&(this.regionRect=t.boundingClientRect,this.anchorRect=i.boundingClientRect,this.viewportElement===document.documentElement?this.viewportRect=new DOMRectReadOnly(o.boundingClientRect.x+document.documentElement.scrollLeft,o.boundingClientRect.y+document.documentElement.scrollTop,o.boundingClientRect.width,o.boundingClientRect.height):this.viewportRect=o.boundingClientRect,this.updateRegionOffset(),this.forceUpdate=!1,!0))},this.updateRegionOffset=()=>{this.anchorRect&&this.regionRect&&(this.baseHorizontalOffset=this.baseHorizontalOffset+(this.anchorRect.left-this.regionRect.left)+(this.translateX-this.baseHorizontalOffset),this.baseVerticalOffset=this.baseVerticalOffset+(this.anchorRect.top-this.regionRect.top)+(this.translateY-this.baseVerticalOffset))},this.isRectDifferent=(e,t)=>Math.abs(e.top-t.top)>this.updateThreshold||Math.abs(e.right-t.right)>this.updateThreshold||Math.abs(e.bottom-t.bottom)>this.updateThreshold||Math.abs(e.left-t.left)>this.updateThreshold,this.handleResize=e=>{this.update()},this.reset=()=>{this.pendingReset&&(this.pendingReset=!1,null===this.anchorElement&&(this.anchorElement=this.getAnchor()),null===this.viewportElement&&(this.viewportElement=this.getViewport()),this.currentDirection=iu(this),this.startObservers())},this.updateLayout=()=>{let e,t;if("uncontrolled"!==this.horizontalPositioningMode){const e=this.getPositioningOptions(this.horizontalInset);if("center"===this.horizontalDefaultPosition)t="center";else if("unset"!==this.horizontalDefaultPosition){let e=this.horizontalDefaultPosition;if("start"===e||"end"===e){const t=iu(this);if(t!==this.currentDirection)return this.currentDirection=t,void this.initialize();e=this.currentDirection===Ul.ltr?"start"===e?"left":"right":"start"===e?"right":"left"}switch(e){case"left":t=this.horizontalInset?"insetStart":"start";break;case"right":t=this.horizontalInset?"insetEnd":"end"}}const i=void 0!==this.horizontalThreshold?this.horizontalThreshold:void 0!==this.regionRect?this.regionRect.width:0,o=void 0!==this.anchorRect?this.anchorRect.left:0,n=void 0!==this.anchorRect?this.anchorRect.right:0,r=void 0!==this.anchorRect?this.anchorRect.width:0,s=void 0!==this.viewportRect?this.viewportRect.left:0,a=void 0!==this.viewportRect?this.viewportRect.right:0;(void 0===t||"locktodefault"!==this.horizontalPositioningMode&&this.getAvailableSpace(t,o,n,r,s,a)this.getAvailableSpace(e[1],o,n,r,s,a)?e[0]:e[1])}if("uncontrolled"!==this.verticalPositioningMode){const t=this.getPositioningOptions(this.verticalInset);if("center"===this.verticalDefaultPosition)e="center";else if("unset"!==this.verticalDefaultPosition)switch(this.verticalDefaultPosition){case"top":e=this.verticalInset?"insetStart":"start";break;case"bottom":e=this.verticalInset?"insetEnd":"end"}const i=void 0!==this.verticalThreshold?this.verticalThreshold:void 0!==this.regionRect?this.regionRect.height:0,o=void 0!==this.anchorRect?this.anchorRect.top:0,n=void 0!==this.anchorRect?this.anchorRect.bottom:0,r=void 0!==this.anchorRect?this.anchorRect.height:0,s=void 0!==this.viewportRect?this.viewportRect.top:0,a=void 0!==this.viewportRect?this.viewportRect.bottom:0;(void 0===e||"locktodefault"!==this.verticalPositioningMode&&this.getAvailableSpace(e,o,n,r,s,a)this.getAvailableSpace(t[1],o,n,r,s,a)?t[0]:t[1])}const i=this.getNextRegionDimension(t,e),o=this.horizontalPosition!==t||this.verticalPosition!==e;if(this.setHorizontalPosition(t,i),this.setVerticalPosition(e,i),this.updateRegionStyle(),!this.initialLayoutComplete)return this.initialLayoutComplete=!0,void this.requestPositionUpdates();this.regionVisible||(this.regionVisible=!0,this.style.removeProperty("pointer-events"),this.style.removeProperty("opacity"),this.classList.toggle("loaded",!0),this.$emit("loaded",this,{bubbles:!1})),this.updatePositionClasses(),o&&this.$emit("positionchange",this,{bubbles:!1})},this.updateRegionStyle=()=>{this.style.width=this.regionWidth,this.style.height=this.regionHeight,this.style.transform=`translate(${this.translateX}px, ${this.translateY}px)`},this.updatePositionClasses=()=>{this.classList.toggle("top","start"===this.verticalPosition),this.classList.toggle("bottom","end"===this.verticalPosition),this.classList.toggle("inset-top","insetStart"===this.verticalPosition),this.classList.toggle("inset-bottom","insetEnd"===this.verticalPosition),this.classList.toggle("vertical-center","center"===this.verticalPosition),this.classList.toggle("left","start"===this.horizontalPosition),this.classList.toggle("right","end"===this.horizontalPosition),this.classList.toggle("inset-left","insetStart"===this.horizontalPosition),this.classList.toggle("inset-right","insetEnd"===this.horizontalPosition),this.classList.toggle("horizontal-center","center"===this.horizontalPosition)},this.setHorizontalPosition=(e,t)=>{if(void 0===e||void 0===this.regionRect||void 0===this.anchorRect||void 0===this.viewportRect)return;let i=0;switch(this.horizontalScaling){case"anchor":case"fill":i=this.horizontalViewportLock?this.viewportRect.width:t.width,this.regionWidth=`${i}px`;break;case"content":i=this.regionRect.width,this.regionWidth="unset"}let o=0;switch(e){case"start":this.translateX=this.baseHorizontalOffset-i,this.horizontalViewportLock&&this.anchorRect.left>this.viewportRect.right&&(this.translateX=this.translateX-(this.anchorRect.left-this.viewportRect.right));break;case"insetStart":this.translateX=this.baseHorizontalOffset-i+this.anchorRect.width,this.horizontalViewportLock&&this.anchorRect.right>this.viewportRect.right&&(this.translateX=this.translateX-(this.anchorRect.right-this.viewportRect.right));break;case"insetEnd":this.translateX=this.baseHorizontalOffset,this.horizontalViewportLock&&this.anchorRect.leftthis.viewportRect.right)?this.translateX=this.translateX-(e-this.viewportRect.left):t>this.viewportRect.right&&!(e{if(void 0===e||void 0===this.regionRect||void 0===this.anchorRect||void 0===this.viewportRect)return;let i=0;switch(this.verticalScaling){case"anchor":case"fill":i=this.verticalViewportLock?this.viewportRect.height:t.height,this.regionHeight=`${i}px`;break;case"content":i=this.regionRect.height,this.regionHeight="unset"}let o=0;switch(e){case"start":this.translateY=this.baseVerticalOffset-i,this.verticalViewportLock&&this.anchorRect.top>this.viewportRect.bottom&&(this.translateY=this.translateY-(this.anchorRect.top-this.viewportRect.bottom));break;case"insetStart":this.translateY=this.baseVerticalOffset-i+this.anchorRect.height,this.verticalViewportLock&&this.anchorRect.bottom>this.viewportRect.bottom&&(this.translateY=this.translateY-(this.anchorRect.bottom-this.viewportRect.bottom));break;case"insetEnd":this.translateY=this.baseVerticalOffset,this.verticalViewportLock&&this.anchorRect.topthis.viewportRect.bottom)?this.translateY=this.translateY-(e-this.viewportRect.top):t>this.viewportRect.bottom&&!(ee?["insetStart","insetEnd"]:["start","end"],this.getAvailableSpace=(e,t,i,o,n,r)=>{const s=t-n,a=r-(t+o);switch(e){case"start":return s;case"insetStart":return s+o;case"insetEnd":return a+o;case"end":return a;case"center":return 2*Math.min(s,a)+o}},this.getNextRegionDimension=(e,t)=>{const i={height:void 0!==this.regionRect?this.regionRect.height:0,width:void 0!==this.regionRect?this.regionRect.width:0};return void 0!==e&&"fill"===this.horizontalScaling?i.width=this.getAvailableSpace(e,void 0!==this.anchorRect?this.anchorRect.left:0,void 0!==this.anchorRect?this.anchorRect.right:0,void 0!==this.anchorRect?this.anchorRect.width:0,void 0!==this.viewportRect?this.viewportRect.left:0,void 0!==this.viewportRect?this.viewportRect.right:0):"anchor"===this.horizontalScaling&&(i.width=void 0!==this.anchorRect?this.anchorRect.width:0),void 0!==t&&"fill"===this.verticalScaling?i.height=this.getAvailableSpace(t,void 0!==this.anchorRect?this.anchorRect.top:0,void 0!==this.anchorRect?this.anchorRect.bottom:0,void 0!==this.anchorRect?this.anchorRect.height:0,void 0!==this.viewportRect?this.viewportRect.top:0,void 0!==this.viewportRect?this.viewportRect.bottom:0):"anchor"===this.verticalScaling&&(i.height=void 0!==this.anchorRect?this.anchorRect.height:0),i},this.startAutoUpdateEventListeners=()=>{window.addEventListener(eu,this.update,{passive:!0}),window.addEventListener(tu,this.update,{passive:!0,capture:!0}),null!==this.resizeDetector&&null!==this.viewportElement&&this.resizeDetector.observe(this.viewportElement)},this.stopAutoUpdateEventListeners=()=>{window.removeEventListener(eu,this.update),window.removeEventListener(tu,this.update),null!==this.resizeDetector&&null!==this.viewportElement&&this.resizeDetector.unobserve(this.viewportElement)}}anchorChanged(){this.initialLayoutComplete&&(this.anchorElement=this.getAnchor())}viewportChanged(){this.initialLayoutComplete&&(this.viewportElement=this.getViewport())}horizontalPositioningModeChanged(){this.requestReset()}horizontalDefaultPositionChanged(){this.updateForAttributeChange()}horizontalViewportLockChanged(){this.updateForAttributeChange()}horizontalInsetChanged(){this.updateForAttributeChange()}horizontalThresholdChanged(){this.updateForAttributeChange()}horizontalScalingChanged(){this.updateForAttributeChange()}verticalPositioningModeChanged(){this.requestReset()}verticalDefaultPositionChanged(){this.updateForAttributeChange()}verticalViewportLockChanged(){this.updateForAttributeChange()}verticalInsetChanged(){this.updateForAttributeChange()}verticalThresholdChanged(){this.updateForAttributeChange()}verticalScalingChanged(){this.updateForAttributeChange()}fixedPlacementChanged(){this.$fastController.isConnected&&this.initialLayoutComplete&&this.initialize()}autoUpdateModeChanged(e,t){this.$fastController.isConnected&&this.initialLayoutComplete&&("auto"===e&&this.stopAutoUpdateEventListeners(),"auto"===t&&this.startAutoUpdateEventListeners())}anchorElementChanged(){this.requestReset()}viewportElementChanged(){this.$fastController.isConnected&&this.initialLayoutComplete&&this.initialize()}connectedCallback(){super.connectedCallback(),"auto"===this.autoUpdateMode&&this.startAutoUpdateEventListeners(),this.initialize()}disconnectedCallback(){super.disconnectedCallback(),"auto"===this.autoUpdateMode&&this.stopAutoUpdateEventListeners(),this.stopObservers(),this.disconnectResizeDetector()}adoptedCallback(){this.initialize()}disconnectResizeDetector(){null!==this.resizeDetector&&(this.resizeDetector.disconnect(),this.resizeDetector=null)}initializeResizeDetector(){this.disconnectResizeDetector(),this.resizeDetector=new window.ResizeObserver(this.handleResize)}updateForAttributeChange(){this.$fastController.isConnected&&this.initialLayoutComplete&&(this.forceUpdate=!0,this.update())}initialize(){this.initializeResizeDetector(),null===this.anchorElement&&(this.anchorElement=this.getAnchor()),this.requestReset()}requestReset(){this.$fastController.isConnected&&!1===this.pendingReset&&(this.setInitialState(),Or.queueUpdate((()=>this.reset())),this.pendingReset=!0)}setInitialState(){this.initialLayoutComplete=!1,this.regionVisible=!1,this.translateX=0,this.translateY=0,this.baseHorizontalOffset=0,this.baseVerticalOffset=0,this.viewportRect=void 0,this.regionRect=void 0,this.anchorRect=void 0,this.verticalPosition=void 0,this.horizontalPosition=void 0,this.style.opacity="0",this.style.pointerEvents="none",this.forceUpdate=!1,this.style.position=this.fixedPlacement?"fixed":"absolute",this.updatePositionClasses(),this.updateRegionStyle()}}ou.intersectionService=new class{constructor(){this.intersectionDetector=null,this.observedElements=new Map,this.requestPosition=(e,t)=>{var i;null!==this.intersectionDetector&&(this.observedElements.has(e)?null===(i=this.observedElements.get(e))||void 0===i||i.push(t):(this.observedElements.set(e,[t]),this.intersectionDetector.observe(e)))},this.cancelRequestPosition=(e,t)=>{const i=this.observedElements.get(e);if(void 0!==i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}},this.initializeIntersectionDetector=()=>{wr.IntersectionObserver&&(this.intersectionDetector=new IntersectionObserver(this.handleIntersection,{root:null,rootMargin:"0px",threshold:[0,1]}))},this.handleIntersection=e=>{if(null===this.intersectionDetector)return;const t=[],i=[];e.forEach((e=>{var o;null===(o=this.intersectionDetector)||void 0===o||o.unobserve(e.target);const n=this.observedElements.get(e.target);void 0!==n&&(n.forEach((o=>{let n=t.indexOf(o);-1===n&&(n=t.length,t.push(o),i.push([])),i[n].push(e)})),this.observedElements.delete(e.target))})),t.forEach(((e,t)=>{e(i[t])}))},this.initializeIntersectionDetector()}},$l([Es],ou.prototype,"anchor",void 0),$l([Es],ou.prototype,"viewport",void 0),$l([Es({attribute:"horizontal-positioning-mode"})],ou.prototype,"horizontalPositioningMode",void 0),$l([Es({attribute:"horizontal-default-position"})],ou.prototype,"horizontalDefaultPosition",void 0),$l([Es({attribute:"horizontal-viewport-lock",mode:"boolean"})],ou.prototype,"horizontalViewportLock",void 0),$l([Es({attribute:"horizontal-inset",mode:"boolean"})],ou.prototype,"horizontalInset",void 0),$l([Es({attribute:"horizontal-threshold"})],ou.prototype,"horizontalThreshold",void 0),$l([Es({attribute:"horizontal-scaling"})],ou.prototype,"horizontalScaling",void 0),$l([Es({attribute:"vertical-positioning-mode"})],ou.prototype,"verticalPositioningMode",void 0),$l([Es({attribute:"vertical-default-position"})],ou.prototype,"verticalDefaultPosition",void 0),$l([Es({attribute:"vertical-viewport-lock",mode:"boolean"})],ou.prototype,"verticalViewportLock",void 0),$l([Es({attribute:"vertical-inset",mode:"boolean"})],ou.prototype,"verticalInset",void 0),$l([Es({attribute:"vertical-threshold"})],ou.prototype,"verticalThreshold",void 0),$l([Es({attribute:"vertical-scaling"})],ou.prototype,"verticalScaling",void 0),$l([Es({attribute:"fixed-placement",mode:"boolean"})],ou.prototype,"fixedPlacement",void 0),$l([Es({attribute:"auto-update-mode"})],ou.prototype,"autoUpdateMode",void 0),$l([Hr],ou.prototype,"anchorElement",void 0),$l([Hr],ou.prototype,"viewportElement",void 0),$l([Hr],ou.prototype,"initialLayoutComplete",void 0);const nu=ou.compose({baseName:"anchored-region",template:(e,t)=>ws` `,styles:(e,t)=>Br` :host { contain: layout; display: block; } `});class ru{}$l([Es({attribute:"aria-atomic"})],ru.prototype,"ariaAtomic",void 0),$l([Es({attribute:"aria-busy"})],ru.prototype,"ariaBusy",void 0),$l([Es({attribute:"aria-controls"})],ru.prototype,"ariaControls",void 0),$l([Es({attribute:"aria-current"})],ru.prototype,"ariaCurrent",void 0),$l([Es({attribute:"aria-describedby"})],ru.prototype,"ariaDescribedby",void 0),$l([Es({attribute:"aria-details"})],ru.prototype,"ariaDetails",void 0),$l([Es({attribute:"aria-disabled"})],ru.prototype,"ariaDisabled",void 0),$l([Es({attribute:"aria-errormessage"})],ru.prototype,"ariaErrormessage",void 0),$l([Es({attribute:"aria-flowto"})],ru.prototype,"ariaFlowto",void 0),$l([Es({attribute:"aria-haspopup"})],ru.prototype,"ariaHaspopup",void 0),$l([Es({attribute:"aria-hidden"})],ru.prototype,"ariaHidden",void 0),$l([Es({attribute:"aria-invalid"})],ru.prototype,"ariaInvalid",void 0),$l([Es({attribute:"aria-keyshortcuts"})],ru.prototype,"ariaKeyshortcuts",void 0),$l([Es({attribute:"aria-label"})],ru.prototype,"ariaLabel",void 0),$l([Es({attribute:"aria-labelledby"})],ru.prototype,"ariaLabelledby",void 0),$l([Es({attribute:"aria-live"})],ru.prototype,"ariaLive",void 0),$l([Es({attribute:"aria-owns"})],ru.prototype,"ariaOwns",void 0),$l([Es({attribute:"aria-relevant"})],ru.prototype,"ariaRelevant",void 0),$l([Es({attribute:"aria-roledescription"})],ru.prototype,"ariaRoledescription",void 0);class su{handleStartContentChange(){this.startContainer.classList.toggle("start",this.start.assignedNodes().length>0)}handleEndContentChange(){this.endContainer.classList.toggle("end",this.end.assignedNodes().length>0)}}const au=(e,t)=>ws` t.end?"end":void 0} > ${t.end||""} `,lu=(e,t)=>ws` ${t.start||""} `;ws` `,ws` `;function cu(e,...t){t.forEach((t=>{if(Object.getOwnPropertyNames(t.prototype).forEach((i=>{"constructor"!==i&&Object.defineProperty(e.prototype,i,Object.getOwnPropertyDescriptor(t.prototype,i))})),t.attributes){const i=e.attributes||[];e.attributes=i.concat(t.attributes)}}))}var du;!function(e){e[e["alt"]=18]="alt",e[e["arrowDown"]=40]="arrowDown",e[e["arrowLeft"]=37]="arrowLeft",e[e["arrowRight"]=39]="arrowRight",e[e["arrowUp"]=38]="arrowUp",e[e["back"]=8]="back",e[e["backSlash"]=220]="backSlash",e[e["break"]=19]="break",e[e["capsLock"]=20]="capsLock",e[e["closeBracket"]=221]="closeBracket",e[e["colon"]=186]="colon",e[e["colon2"]=59]="colon2",e[e["comma"]=188]="comma",e[e["ctrl"]=17]="ctrl",e[e["delete"]=46]="delete",e[e["end"]=35]="end",e[e["enter"]=13]="enter",e[e["equals"]=187]="equals",e[e["equals2"]=61]="equals2",e[e["equals3"]=107]="equals3",e[e["escape"]=27]="escape",e[e["forwardSlash"]=191]="forwardSlash",e[e["function1"]=112]="function1",e[e["function10"]=121]="function10",e[e["function11"]=122]="function11",e[e["function12"]=123]="function12",e[e["function2"]=113]="function2",e[e["function3"]=114]="function3",e[e["function4"]=115]="function4",e[e["function5"]=116]="function5",e[e["function6"]=117]="function6",e[e["function7"]=118]="function7",e[e["function8"]=119]="function8",e[e["function9"]=120]="function9",e[e["home"]=36]="home",e[e["insert"]=45]="insert",e[e["menu"]=93]="menu",e[e["minus"]=189]="minus",e[e["minus2"]=109]="minus2",e[e["numLock"]=144]="numLock",e[e["numPad0"]=96]="numPad0",e[e["numPad1"]=97]="numPad1",e[e["numPad2"]=98]="numPad2",e[e["numPad3"]=99]="numPad3",e[e["numPad4"]=100]="numPad4",e[e["numPad5"]=101]="numPad5",e[e["numPad6"]=102]="numPad6",e[e["numPad7"]=103]="numPad7",e[e["numPad8"]=104]="numPad8",e[e["numPad9"]=105]="numPad9",e[e["numPadDivide"]=111]="numPadDivide",e[e["numPadDot"]=110]="numPadDot",e[e["numPadMinus"]=109]="numPadMinus",e[e["numPadMultiply"]=106]="numPadMultiply",e[e["numPadPlus"]=107]="numPadPlus",e[e["openBracket"]=219]="openBracket",e[e["pageDown"]=34]="pageDown",e[e["pageUp"]=33]="pageUp",e[e["period"]=190]="period",e[e["print"]=44]="print",e[e["quote"]=222]="quote",e[e["scrollLock"]=145]="scrollLock",e[e["shift"]=16]="shift",e[e["space"]=32]="space",e[e["tab"]=9]="tab",e[e["tilde"]=192]="tilde",e[e["windowsLeft"]=91]="windowsLeft",e[e["windowsOpera"]=219]="windowsOpera",e[e["windowsRight"]=92]="windowsRight"}(du||(du={}));const hu="ArrowDown",uu="ArrowLeft",pu="ArrowRight",gu="ArrowUp",fu="Enter",vu="Escape",bu="Home",mu="End",yu=" ",wu="Tab",xu={ArrowDown:hu,ArrowLeft:uu,ArrowRight:pu,ArrowUp:gu},ku="form-associated-proxy",Su="ElementInternals",Cu=Su in window&&"setFormValue"in window[Su].prototype,$u=new WeakMap;function Nu(e){const t=class extends e{constructor(...e){super(...e),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return Cu}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const e=this.proxy.labels,t=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)),i=e?t.concat(Array.from(e)):t;return Object.freeze(i)}return Sr}valueChanged(e,t){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.currentValue=this.value,this.setFormValue(this.value),this.validate()}currentValueChanged(){this.value=this.currentValue}initialValueChanged(e,t){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),Or.queueUpdate((()=>this.classList.toggle("disabled",this.disabled)))}nameChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),Or.queueUpdate((()=>this.classList.toggle("required",this.required))),this.validate()}get elementInternals(){if(!Cu)return null;let e=$u.get(this);return e||(e=this.attachInternals(),$u.set(this,e)),e}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){this.proxyEventsToBlock.forEach((e=>this.proxy.removeEventListener(e,this.stopPropagation))),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(e,t,i){this.elementInternals?this.elementInternals.setValidity(e,t,i):"string"==typeof t&&this.proxy.setCustomValidity(t)}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){var e;this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach((e=>this.proxy.addEventListener(e,this.stopPropagation))),this.proxy.disabled=this.disabled,this.proxy.required=this.required,"string"==typeof this.name&&(this.proxy.name=this.name),"string"==typeof this.value&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",ku),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",ku)),null===(e=this.shadowRoot)||void 0===e||e.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){var e;this.removeChild(this.proxy),null===(e=this.shadowRoot)||void 0===e||e.removeChild(this.proxySlot)}validate(){this.proxy instanceof HTMLElement&&this.setValidity(this.proxy.validity,this.proxy.validationMessage)}setFormValue(e,t){this.elementInternals&&this.elementInternals.setFormValue(e,t||e)}_keypressHandler(e){if(e.key===fu)if(this.form instanceof HTMLFormElement){const e=this.form.querySelector("[type=submit]");null==e||e.click()}}stopPropagation(e){e.stopPropagation()}};return Es({mode:"boolean"})(t.prototype,"disabled"),Es({mode:"fromView",attribute:"value"})(t.prototype,"initialValue"),Es({attribute:"current-value"})(t.prototype,"currentValue"),Es(t.prototype,"name"),Es({mode:"boolean"})(t.prototype,"required"),Hr(t.prototype,"value"),t}function Eu(e){class t extends(Nu(e)){}class i extends t{constructor(...e){super(e),this.dirtyChecked=!1,this.checkedAttribute=!1,this.checked=!1,this.dirtyChecked=!1}checkedAttributeChanged(){this.defaultChecked=this.checkedAttribute}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(e,t){this.dirtyChecked||(this.dirtyChecked=!0),this.currentChecked=this.checked,this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),void 0!==e&&this.$emit("change"),this.validate()}currentCheckedChanged(e,t){this.checked=this.currentChecked}updateForm(){const e=this.checked?this.value:null;this.setFormValue(e,e)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.checkedAttribute,this.dirtyChecked=!1}}return Es({attribute:"checked",mode:"boolean"})(i.prototype,"checkedAttribute"),Es({attribute:"current-checked",converter:Cs})(i.prototype,"currentChecked"),Hr(i.prototype,"defaultChecked"),Hr(i.prototype,"checked"),i}class Lu extends Hh{}class Tu extends(Nu(Lu)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class Ou extends Tu{constructor(){super(...arguments),this.handleClick=e=>{var t;this.disabled&&(null===(t=this.defaultSlottedContent)||void 0===t?void 0:t.length)<=1&&e.stopPropagation()},this.handleSubmission=()=>{if(!this.form)return;const e=this.proxy.isConnected;e||this.attachProxy(),"function"==typeof this.form.requestSubmit?this.form.requestSubmit(this.proxy):this.proxy.click(),e||this.detachProxy()},this.handleFormReset=()=>{var e;null===(e=this.form)||void 0===e||e.reset()},this.handleUnsupportedDelegatesFocus=()=>{var e;window.ShadowRoot&&!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus")&&(null===(e=this.$fastController.definition.shadowOptions)||void 0===e?void 0:e.delegatesFocus)&&(this.focus=()=>{this.control.focus()})}}formactionChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formAction=this.formaction)}formenctypeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formEnctype=this.formenctype)}formmethodChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formMethod=this.formmethod)}formnovalidateChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formNoValidate=this.formnovalidate)}formtargetChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.formTarget=this.formtarget)}typeChanged(e,t){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type),"submit"===t&&this.addEventListener("click",this.handleSubmission),"submit"===e&&this.removeEventListener("click",this.handleSubmission),"reset"===t&&this.addEventListener("click",this.handleFormReset),"reset"===e&&this.removeEventListener("click",this.handleFormReset)}connectedCallback(){var e;super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.handleUnsupportedDelegatesFocus();const t=Array.from(null===(e=this.control)||void 0===e?void 0:e.children);t&&t.forEach((e=>{e.addEventListener("click",this.handleClick)}))}disconnectedCallback(){var e;super.disconnectedCallback();const t=Array.from(null===(e=this.control)||void 0===e?void 0:e.children);t&&t.forEach((e=>{e.removeEventListener("click",this.handleClick)}))}}$l([Es({mode:"boolean"})],Ou.prototype,"autofocus",void 0),$l([Es({attribute:"form"})],Ou.prototype,"formId",void 0),$l([Es],Ou.prototype,"formaction",void 0),$l([Es],Ou.prototype,"formenctype",void 0),$l([Es],Ou.prototype,"formmethod",void 0),$l([Es({mode:"boolean"})],Ou.prototype,"formnovalidate",void 0),$l([Es],Ou.prototype,"formtarget",void 0),$l([Es],Ou.prototype,"type",void 0),$l([Hr],Ou.prototype,"defaultSlottedContent",void 0);class _u{}$l([Es({attribute:"aria-expanded"})],_u.prototype,"ariaExpanded",void 0),$l([Es({attribute:"aria-pressed"})],_u.prototype,"ariaPressed",void 0),cu(_u,ru),cu(Ou,su,_u);class Iu extends class{constructor(e,t){this.target=e,this.options=t,this.source=null}bind(e){const t=this.options.property;this.shouldUpdate=zr.getAccessors(e).some((e=>e.name===t)),this.source=e,this.updateTarget(this.computeNodes()),this.shouldUpdate&&this.observe()}unbind(){this.updateTarget(Sr),this.source=null,this.shouldUpdate&&this.disconnect()}handleEvent(){this.updateTarget(this.computeNodes())}computeNodes(){let e=this.getNodes();return void 0!==this.options.filter&&(e=e.filter(this.options.filter)),e}updateTarget(e){this.source[this.options.property]=e}}{constructor(e,t){super(e,t)}observe(){this.target.addEventListener("slotchange",this)}disconnect(){this.target.removeEventListener("slotchange",this)}getNodes(){return this.target.assignedNodes(this.options)}}function Du(e){return"string"==typeof e&&(e={property:e}),new Yr("fast-slotted",Iu,e)}const Ru="not-allowed";class Pu extends class{constructor(e){this.listenerCache=new WeakMap,this.query=e}bind(e){const{query:t}=this,i=this.constructListener(e);i.bind(t)(),t.addListener(i),this.listenerCache.set(e,i)}unbind(e){const t=this.listenerCache.get(e);t&&(this.query.removeListener(t),this.listenerCache.delete(e))}}{constructor(e,t){super(e),this.styles=t}static with(e){return t=>new Pu(e,t)}constructListener(e){let t=!1;const i=this.styles;return function(){const{matches:o}=this;o&&!t?(e.$fastController.addStyles(i),t=o):!o&&t&&(e.$fastController.removeStyles(i),t=o)}}unbind(e){super.unbind(e),e.$fastController.removeStyles(this.styles)}}const Au=Pu.with(window.matchMedia("(forced-colors)"));Pu.with(window.matchMedia("(prefers-color-scheme: dark)")),Pu.with(window.matchMedia("(prefers-color-scheme: light)"));var Fu;!function(e){e["Canvas"]="Canvas",e["CanvasText"]="CanvasText",e["LinkText"]="LinkText",e["VisitedText"]="VisitedText",e["ActiveText"]="ActiveText",e["ButtonFace"]="ButtonFace",e["ButtonText"]="ButtonText",e["Field"]="Field",e["FieldText"]="FieldText",e["Highlight"]="Highlight",e["HighlightText"]="HighlightText",e["GrayText"]="GrayText"}(Fu||(Fu={}));const Bu=`:host([hidden]){display:none}`;function Mu(e){return`${Bu}:host{display:${e}}`}function Vu(...e){return e.every((e=>e instanceof HTMLElement))}let ju;const zu=function(){if("boolean"==typeof ju)return ju;if("undefined"==typeof window||!window.document||!window.document.createElement)return ju=!1,ju;const e=document.createElement("style"),t=function(){const e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}();null!==t&&e.setAttribute("nonce",t),document.head.appendChild(e);try{e.sheet.insertRule("foo:focus-visible {color:inherit}",0),ju=!0}catch(e){ju=!1}finally{document.head.removeChild(e)}return ju}()?"focus-visible":"focus",Hu=(function(e,...t){const{styles:i,behaviors:o}=Fr(e,t);return new Mr(i,o)})`(${bc} + ${xc}) * ${kc}`,Uu=Br` ${Mu("inline-flex")} :host { font-family: ${vc}; outline: none; font-size: ${Ec}; line-height: ${Lc}; height: calc(${Hu} * 1px); min-width: calc(${Hu} * 1px); background-color: ${th}; color: ${kh}; border-radius: calc(${wc} * 1px); fill: currentcolor; cursor: pointer; } .control { background: transparent; height: inherit; flex-grow: 1; box-sizing: border-box; display: inline-flex; justify-content: center; align-items: baseline; padding: 0 calc((10 + (${kc} * 2 * ${xc})) * 1px); white-space: nowrap; outline: none; text-decoration: none; border: calc(${$c} * 1px) solid transparent; color: inherit; border-radius: inherit; fill: inherit; cursor: inherit; font-weight: inherit; font-family: inherit; font-size: inherit; line-height: inherit; } :host(:hover) { background-color: ${ih}; } :host(:active) { background-color: ${oh}; } .control:${zu} { border-color: ${vh}; box-shadow: 0 0 0 calc((${Nc} - ${$c}) * 1px) ${vh} inset; } .control::-moz-focus-inner { border: 0; } .start, .content, .end { align-self: center; } .start, .end { display: flex; } .control.icon-only { padding: 0; line-height: 0; } ::slotted(svg) { ${""} width: 16px; height: 16px; pointer-events: none; } .start { margin-inline-end: 11px; } .end { margin-inline-start: 11px; } `.withBehaviors(Au(Br` :host .control { background-color: ${Fu.ButtonFace}; border-color: ${Fu.ButtonText}; color: ${Fu.ButtonText}; fill: currentColor; } :host(:hover) .control { forced-color-adjust: none; background-color: ${Fu.Highlight}; color: ${Fu.HighlightText}; } .control:${zu} { forced-color-adjust: none; background-color: ${Fu.Highlight}; border-color: ${Fu.ButtonText}; box-shadow: 0 0 0 calc((${Nc} - ${$c}) * 1px) ${Fu.ButtonText} inset; color: ${Fu.HighlightText}; } .control:hover, :host([appearance="outline"]) .control:hover { border-color: ${Fu.ButtonText}; } :host([href]) .control { border-color: ${Fu.LinkText}; color: ${Fu.LinkText}; } :host([href]) .control:hover, :host([href]) .control:${zu}{ forced-color-adjust: none; background: ${Fu.ButtonFace}; border-color: ${Fu.LinkText}; box-shadow: 0 0 0 1px ${Fu.LinkText} inset; color: ${Fu.LinkText}; fill: currentColor; } `)),qu=Br` :host([appearance="accent"]) { background: ${Bd}; color: ${Ud}; } :host([appearance="accent"]:hover) { background: ${Md}; color: ${qd}; } :host([appearance="accent"]:active) .control:active { background: ${Vd}; color: ${Kd}; } :host([appearance="accent"]) .control:${zu} { box-shadow: 0 0 0 calc((${Nc} - ${$c}) * 1px) ${vh} inset, 0 0 0 calc((${Nc} + ${$c}) * 1px) ${mh} inset; } `.withBehaviors(Au(Br` :host([appearance="accent"]) .control { forced-color-adjust: none; background: ${Fu.Highlight}; color: ${Fu.HighlightText}; } :host([appearance="accent"]) .control:hover, :host([appearance="accent"]:active) .control:active { background: ${Fu.HighlightText}; border-color: ${Fu.Highlight}; color: ${Fu.Highlight}; } :host([appearance="accent"]) .control:${zu} { border-color: ${Fu.Highlight}; box-shadow: 0 0 0 calc(${Nc} * 1px) ${Fu.HighlightText} inset; } :host([appearance="accent"][href]) .control{ background: ${Fu.LinkText}; color: ${Fu.HighlightText}; } :host([appearance="accent"][href]) .control:hover { background: ${Fu.ButtonFace}; border-color: ${Fu.LinkText}; box-shadow: none; color: ${Fu.LinkText}; fill: currentColor; } :host([appearance="accent"][href]) .control:${zu} { border-color: ${Fu.LinkText}; box-shadow: 0 0 0 calc(${Nc} * 1px) ${Fu.HighlightText} inset; } `)),Ku=(Br` :host([appearance="hypertext"]) { font-size: inherit; line-height: inherit; height: auto; min-width: 0; background: transparent; } :host([appearance="hypertext"]) .control { display: inline; padding: 0; border: none; box-shadow: none; border-radius: 0; line-height: 1; } :host a.control:not(:link) { background-color: transparent; cursor: default; } :host([appearance="hypertext"]) .control:link, :host([appearance="hypertext"]) .control:visited { background: transparent; color: ${Qd}; border-bottom: calc(${$c} * 1px) solid ${Qd}; } :host([appearance="hypertext"]:hover), :host([appearance="hypertext"]) .control:hover { background: transparent; border-bottom-color: ${Zd}; } :host([appearance="hypertext"]:active), :host([appearance="hypertext"]) .control:active { background: transparent; border-bottom-color: ${Jd}; } :host([appearance="hypertext"]) .control:${zu} { border-bottom: calc(${Nc} * 1px) solid ${vh}; margin-bottom: calc(calc(${$c} - ${Nc}) * 1px); } `.withBehaviors(Au(Br` :host([appearance="hypertext"]:hover) { background-color: ${Fu.ButtonFace}; color: ${Fu.ButtonText}; } :host([appearance="hypertext"][href]) .control:hover, :host([appearance="hypertext"][href]) .control:active, :host([appearance="hypertext"][href]) .control:${zu} { color: ${Fu.LinkText}; border-bottom-color: ${Fu.LinkText}; box-shadow: none; } `)),Br` :host([appearance="lightweight"]) { background: transparent; color: ${Qd}; } :host([appearance="lightweight"]) .control { padding: 0; height: initial; border: none; box-shadow: none; border-radius: 0; } :host([appearance="lightweight"]:hover) { background: transparent; color: ${Zd}; } :host([appearance="lightweight"]:active) { background: transparent; color: ${Jd}; } :host([appearance="lightweight"]) .content { position: relative; } :host([appearance="lightweight"]) .content::before { content: ""; display: block; height: calc(${$c} * 1px); position: absolute; top: calc(1em + 4px); width: 100%; } :host([appearance="lightweight"]:hover) .content::before { background: ${Zd}; } :host([appearance="lightweight"]:active) .content::before { background: ${Jd}; } :host([appearance="lightweight"]) .control:${zu} .content::before { background: ${kh}; height: calc(${Nc} * 1px); } `.withBehaviors(Au(Br` :host([appearance="lightweight"]) .control:hover, :host([appearance="lightweight"]) .control:${zu} { forced-color-adjust: none; background: ${Fu.ButtonFace}; color: ${Fu.Highlight}; } :host([appearance="lightweight"]) .control:hover .content::before, :host([appearance="lightweight"]) .control:${zu} .content::before { background: ${Fu.Highlight}; } :host([appearance="lightweight"][href]) .control:hover, :host([appearance="lightweight"][href]) .control:${zu} { background: ${Fu.ButtonFace}; box-shadow: none; color: ${Fu.LinkText}; } :host([appearance="lightweight"][href]) .control:hover .content::before, :host([appearance="lightweight"][href]) .control:${zu} .content::before { background: ${Fu.LinkText}; } `))),Wu=Br` :host([appearance="outline"]) { background: transparent; border-color: ${Bd}; } :host([appearance="outline"]:hover) { border-color: ${Md}; } :host([appearance="outline"]:active) { border-color: ${Vd}; } :host([appearance="outline"]) .control { border-color: inherit; } :host([appearance="outline"]) .control:${zu} { box-shadow: 0 0 0 calc((${Nc} - ${$c}) * 1px) ${vh} inset; border-color: ${vh}; } `.withBehaviors(Au(Br` :host([appearance="outline"]) .control { border-color: ${Fu.ButtonText}; } :host([appearance="outline"]) .control:${zu} { forced-color-adjust: none; background-color: ${Fu.Highlight}; border-color: ${Fu.ButtonText}; box-shadow: 0 0 0 calc((${Nc} - ${$c}) * 1px) ${Fu.ButtonText} inset; color: ${Fu.HighlightText}; fill: currentColor; } :host([appearance="outline"][href]) .control { background: ${Fu.ButtonFace}; border-color: ${Fu.LinkText}; color: ${Fu.LinkText}; fill: currentColor; } :host([appearance="outline"][href]) .control:hover, :host([appearance="outline"][href]) .control:${zu} { forced-color-adjust: none; border-color: ${Fu.LinkText}; box-shadow: 0 0 0 1px ${Fu.LinkText} inset; } `)),Gu=Br` :host([appearance="stealth"]) { background: ${ch}; } :host([appearance="stealth"]:hover) { background: ${dh}; } :host([appearance="stealth"]:active) { background: ${hh}; } `.withBehaviors(Au(Br` :host([appearance="stealth"]), :host([appearance="stealth"]) .control { forced-color-adjust: none; background: ${Fu.ButtonFace}; border-color: transparent; color: ${Fu.ButtonText}; fill: currentColor; } :host([appearance="stealth"]:hover) .control { background: ${Fu.Highlight}; border-color: ${Fu.Highlight}; color: ${Fu.HighlightText}; fill: currentColor; } :host([appearance="stealth"]:${zu}) .control { background: ${Fu.Highlight}; box-shadow: 0 0 0 1px ${Fu.Highlight}; color: ${Fu.HighlightText}; fill: currentColor; } :host([appearance="stealth"][href]) .control { color: ${Fu.LinkText}; } :host([appearance="stealth"][href]:hover) .control, :host([appearance="stealth"][href]:${zu}) .control { background: ${Fu.LinkText}; border-color: ${Fu.LinkText}; color: ${Fu.HighlightText}; fill: currentColor; } :host([appearance="stealth"][href]:${zu}) .control { forced-color-adjust: none; box-shadow: 0 0 0 1px ${Fu.LinkText}; } `));class Xu{constructor(e,t,i){this.propertyName=e,this.value=t,this.styles=i}bind(e){zr.getNotifier(e).subscribe(this,this.propertyName),this.handleChange(e,this.propertyName)}unbind(e){zr.getNotifier(e).unsubscribe(this,this.propertyName),e.$fastController.removeStyles(this.styles)}handleChange(e,t){e[t]===this.value?e.$fastController.addStyles(this.styles):e.$fastController.removeStyles(this.styles)}}function Yu(e,t){return new Xu("appearance",e,t)}class Qu extends Ou{constructor(){super(...arguments),this.appearance="neutral"}defaultSlottedContentChanged(e,t){const i=this.defaultSlottedContent.filter((e=>e.nodeType===Node.ELEMENT_NODE));1===i.length&&i[0]instanceof SVGElement?this.control.classList.add("icon-only"):this.control.classList.remove("icon-only")}}$l([Es],Qu.prototype,"appearance",void 0);const Zu=Qu.compose({baseName:"button",baseClass:Ou,template:(e,t)=>ws` `,styles:(e,t)=>Br` :host([disabled]), :host([disabled]:hover), :host([disabled]:active) { opacity: ${Cc}; background-color: ${th}; cursor: ${Ru}; } ${Uu} `.withBehaviors(Au(Br` :host([disabled]), :host([disabled]) .control, :host([disabled]:hover), :host([disabled]:active) { forced-color-adjust: none; background-color: ${Fu.ButtonFace}; border-color: ${Fu.GrayText}; color: ${Fu.GrayText}; cursor: ${Ru}; opacity: 1; } `),Yu("accent",Br` :host([appearance="accent"][disabled]), :host([appearance="accent"][disabled]:hover), :host([appearance="accent"][disabled]:active) { background: ${Bd}; } ${qu} `.withBehaviors(Au(Br` :host([appearance="accent"][disabled]) .control, :host([appearance="accent"][disabled]) .control:hover { background: ${Fu.ButtonFace}; border-color: ${Fu.GrayText}; color: ${Fu.GrayText}; } `))),Yu("lightweight",Br` :host([appearance="lightweight"][disabled]:hover), :host([appearance="lightweight"][disabled]:active) { background-color: transparent; color: ${Qd}; } :host([appearance="lightweight"][disabled]) .content::before, :host([appearance="lightweight"][disabled]:hover) .content::before, :host([appearance="lightweight"][disabled]:active) .content::before { background: transparent; } ${Ku} `.withBehaviors(Au(Br` :host([appearance="lightweight"].disabled) .control { forced-color-adjust: none; color: ${Fu.GrayText}; } :host([appearance="lightweight"].disabled) .control:hover .content::before { background: none; } `))),Yu("outline",Br` :host([appearance="outline"][disabled]), :host([appearance="outline"][disabled]:hover), :host([appearance="outline"][disabled]:active) { background: transparent; border-color: ${Bd}; } ${Wu} `.withBehaviors(Au(Br` :host([appearance="outline"][disabled]) .control { border-color: ${Fu.GrayText}; } `))),Yu("stealth",Br` :host([appearance="stealth"][disabled]), :host([appearance="stealth"][disabled]:hover), :host([appearance="stealth"][disabled]:active) { background: ${ch}; } ${Gu} `.withBehaviors(Au(Br` :host([appearance="stealth"][disabled]) { background: ${Fu.ButtonFace}; } :host([appearance="stealth"][disabled]) .control { background: ${Fu.ButtonFace}; border-color: transparent; color: ${Fu.GrayText}; } `)))),shadowOptions:{delegatesFocus:!0}});class Ju extends Hh{}class ep extends(Eu(Ju)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class tp extends ep{constructor(){super(),this.initialValue="on",this.indeterminate=!1,this.keypressHandler=e=>{if(!this.readOnly&&e.key===yu)this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked},this.clickHandler=e=>{this.disabled||this.readOnly||(this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked)},this.proxy.setAttribute("type","checkbox")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}}$l([Es({attribute:"readonly",mode:"boolean"})],tp.prototype,"readOnly",void 0),$l([Hr],tp.prototype,"defaultSlottedNodes",void 0),$l([Hr],tp.prototype,"indeterminate",void 0);const ip=tp.compose({baseName:"checkbox",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("inline-flex")} :host { align-items: center; outline: none; margin: calc(${kc} * 1px) 0; /* Chromium likes to select label text or the default slot when the checkbox is clicked. Maybe there is a better solution here? */ user-select: none; } .control { position: relative; width: calc((${Hu} / 2 + ${kc}) * 1px); height: calc((${Hu} / 2 + ${kc}) * 1px); box-sizing: border-box; border-radius: calc(${wc} * 1px); border: calc(${$c} * 1px) solid ${Ch}; background: ${rh}; outline: none; cursor: pointer; } .label { font-family: ${vc}; color: ${kh}; padding-inline-start: calc(${kc} * 2px + 2px); margin-inline-end: calc(${kc} * 2px + 2px); cursor: pointer; font-size: ${Ec}; line-height: ${Lc}; } .label__hidden { display: none; visibility: hidden; } .checked-indicator { width: 100%; height: 100%; display: block; fill: ${Ud}; opacity: 0; pointer-events: none; } .indeterminate-indicator { border-radius: calc(${wc} * 1px); background: ${Ud}; position: absolute; top: 50%; left: 50%; width: 50%; height: 50%; transform: translate(-50%, -50%); opacity: 0; } :host(:not([disabled])) .control:hover { background: ${sh}; border-color: ${$h}; } :host(:not([disabled])) .control:active { background: ${ah}; border-color: ${Nh}; } :host(:${zu}) .control { box-shadow: 0 0 0 2px ${Pd}, 0 0 0 4px ${vh}; } :host([aria-checked="true"]) .control { background: ${Bd}; border: calc(${$c} * 1px) solid ${Bd}; } :host([aria-checked="true"]:not([disabled])) .control:hover { background: ${Md}; border: calc(${$c} * 1px) solid ${Md}; } :host([aria-checked="true"]:not([disabled])) .control:hover .checked-indicator { fill: ${qd}; } :host([aria-checked="true"]:not([disabled])) .control:hover .indeterminate-indicator { background: ${qd}; } :host([aria-checked="true"]:not([disabled])) .control:active { background: ${Vd}; border: calc(${$c} * 1px) solid ${Vd}; } :host([aria-checked="true"]:not([disabled])) .control:active .checked-indicator { fill: ${Kd}; } :host([aria-checked="true"]:not([disabled])) .control:active .indeterminate-indicator { background: ${Kd}; } :host([aria-checked="true"]:${zu}:not([disabled])) .control { box-shadow: 0 0 0 2px ${Pd}, 0 0 0 4px ${vh}; } :host([disabled]) .label, :host([readonly]) .label, :host([readonly]) .control, :host([disabled]) .control { cursor: ${Ru}; } :host([aria-checked="true"]:not(.indeterminate)) .checked-indicator, :host(.indeterminate) .indeterminate-indicator { opacity: 1; } :host([disabled]) { opacity: ${Cc}; } `.withBehaviors(Au(Br` .control { forced-color-adjust: none; border-color: ${Fu.FieldText}; background: ${Fu.Field}; } .checked-indicator { fill: ${Fu.FieldText}; } .indeterminate-indicator { background: ${Fu.FieldText}; } :host(:not([disabled])) .control:hover, .control:active { border-color: ${Fu.Highlight}; background: ${Fu.Field}; } :host(:${zu}) .control { box-shadow: 0 0 0 2px ${Fu.Field}, 0 0 0 4px ${Fu.FieldText}; } :host([aria-checked="true"]:${zu}:not([disabled])) .control { box-shadow: 0 0 0 2px ${Fu.Field}, 0 0 0 4px ${Fu.FieldText}; } :host([aria-checked="true"]) .control { background: ${Fu.Highlight}; border-color: ${Fu.Highlight}; } :host([aria-checked="true"]:not([disabled])) .control:hover, .control:active { border-color: ${Fu.Highlight}; background: ${Fu.HighlightText}; } :host([aria-checked="true"]) .checked-indicator { fill: ${Fu.HighlightText}; } :host([aria-checked="true"]:not([disabled])) .control:hover .checked-indicator { fill: ${Fu.Highlight} } :host([aria-checked="true"]) .indeterminate-indicator { background: ${Fu.HighlightText}; } :host([aria-checked="true"]) .control:hover .indeterminate-indicator { background: ${Fu.Highlight} } :host([disabled]) { opacity: 1; } :host([disabled]) .control { forced-color-adjust: none; border-color: ${Fu.GrayText}; background: ${Fu.Field}; } :host([disabled]) .indeterminate-indicator, :host([aria-checked="true"][disabled]) .control:hover .indeterminate-indicator { forced-color-adjust: none; background: ${Fu.GrayText}; } :host([disabled]) .checked-indicator, :host([aria-checked="true"][disabled]) .control:hover .checked-indicator { forced-color-adjust: none; fill: ${Fu.GrayText}; } `)),checkedIndicator:`\n \n \n \n `,indeterminateIndicator:`\n
\n `}),op={toView:e=>null==e?null:null==e?void 0:e.toColorString(),fromView(e){if(null==e)return null;const t=tc(e);return t?wl.create(t.r,t.g,t.b):null}},np=Br` :host { background-color: ${Pd}; color: ${kh}; } `.withBehaviors(Au(Br` :host { background-color: ${Fu.ButtonFace}; box-shadow: 0 0 0 1px ${Fu.CanvasText}; color: ${Fu.ButtonText}; } `));function rp(e){return(t,i)=>{t[i+"Changed"]=function(t,i){null!=i?e.setValueFor(this,i):e.deleteValueFor(this)}}}class sp extends Hh{constructor(){super(),this.noPaint=!1;const e={handleChange:this.noPaintChanged.bind(this)};zr.getNotifier(this).subscribe(e,"fillColor"),zr.getNotifier(this).subscribe(e,"baseLayerLuminance")}noPaintChanged(){this.noPaint||void 0===this.fillColor&&!this.baseLayerLuminance?this.$fastController.removeStyles(np):this.$fastController.addStyles(np)}}$l([Es({attribute:"no-paint",mode:"boolean"})],sp.prototype,"noPaint",void 0),$l([Es({attribute:"fill-color",converter:op}),rp(Pd)],sp.prototype,"fillColor",void 0),$l([Es({attribute:"accent-color",converter:op,mode:"fromView"}),rp(Sd)],sp.prototype,"accentColor",void 0),$l([Es({attribute:"neutral-color",converter:op,mode:"fromView"}),rp(xd)],sp.prototype,"neutralColor",void 0),$l([Es({converter:$s}),rp(xc)],sp.prototype,"density",void 0),$l([Es({attribute:"design-unit",converter:$s}),rp(kc)],sp.prototype,"designUnit",void 0),$l([Es({attribute:"direction"}),rp(Sc)],sp.prototype,"direction",void 0),$l([Es({attribute:"base-height-multiplier",converter:$s}),rp(bc)],sp.prototype,"baseHeightMultiplier",void 0),$l([Es({attribute:"base-horizontal-spacing-multiplier",converter:$s}),rp(mc)],sp.prototype,"baseHorizontalSpacingMultiplier",void 0),$l([Es({attribute:"control-corner-radius",converter:$s}),rp(wc)],sp.prototype,"controlCornerRadius",void 0),$l([Es({attribute:"stroke-width",converter:$s}),rp($c)],sp.prototype,"strokeWidth",void 0),$l([Es({attribute:"focus-stroke-width",converter:$s}),rp(Nc)],sp.prototype,"focusStrokeWidth",void 0),$l([Es({attribute:"disabled-opacity",converter:$s}),rp(Cc)],sp.prototype,"disabledOpacity",void 0),$l([Es({attribute:"type-ramp-minus-2-font-size"}),rp(_c)],sp.prototype,"typeRampMinus2FontSize",void 0),$l([Es({attribute:"type-ramp-minus-2-line-height"}),rp(Ic)],sp.prototype,"typeRampMinus2LineHeight",void 0),$l([Es({attribute:"type-ramp-minus-1-font-size"}),rp(Tc)],sp.prototype,"typeRampMinus1FontSize",void 0),$l([Es({attribute:"type-ramp-minus-1-line-height"}),rp(Oc)],sp.prototype,"typeRampMinus1LineHeight",void 0),$l([Es({attribute:"type-ramp-base-font-size"}),rp(Ec)],sp.prototype,"typeRampBaseFontSize",void 0),$l([Es({attribute:"type-ramp-base-line-height"}),rp(Lc)],sp.prototype,"typeRampBaseLineHeight",void 0),$l([Es({attribute:"type-ramp-plus-1-font-size"}),rp(Dc)],sp.prototype,"typeRampPlus1FontSize",void 0),$l([Es({attribute:"type-ramp-plus-1-line-height"}),rp(Rc)],sp.prototype,"typeRampPlus1LineHeight",void 0),$l([Es({attribute:"type-ramp-plus-2-font-size"}),rp(Pc)],sp.prototype,"typeRampPlus2FontSize",void 0),$l([Es({attribute:"type-ramp-plus-2-line-height"}),rp(Ac)],sp.prototype,"typeRampPlus2LineHeight",void 0),$l([Es({attribute:"type-ramp-plus-3-font-size"}),rp(Fc)],sp.prototype,"typeRampPlus3FontSize",void 0),$l([Es({attribute:"type-ramp-plus-3-line-height"}),rp(Bc)],sp.prototype,"typeRampPlus3LineHeight",void 0),$l([Es({attribute:"type-ramp-plus-4-font-size"}),rp(Mc)],sp.prototype,"typeRampPlus4FontSize",void 0),$l([Es({attribute:"type-ramp-plus-4-line-height"}),rp(Vc)],sp.prototype,"typeRampPlus4LineHeight",void 0),$l([Es({attribute:"type-ramp-plus-5-font-size"}),rp(jc)],sp.prototype,"typeRampPlus5FontSize",void 0),$l([Es({attribute:"type-ramp-plus-5-line-height"}),rp(zc)],sp.prototype,"typeRampPlus5LineHeight",void 0),$l([Es({attribute:"type-ramp-plus-6-font-size"}),rp(Hc)],sp.prototype,"typeRampPlus6FontSize",void 0),$l([Es({attribute:"type-ramp-plus-6-line-height"}),rp(Uc)],sp.prototype,"typeRampPlus6LineHeight",void 0),$l([Es({attribute:"accent-fill-rest-delta",converter:$s}),rp(qc)],sp.prototype,"accentFillRestDelta",void 0),$l([Es({attribute:"accent-fill-hover-delta",converter:$s}),rp(Kc)],sp.prototype,"accentFillHoverDelta",void 0),$l([Es({attribute:"accent-fill-active-delta",converter:$s}),rp(Wc)],sp.prototype,"accentFillActiveDelta",void 0),$l([Es({attribute:"accent-fill-focus-delta",converter:$s}),rp(Gc)],sp.prototype,"accentFillFocusDelta",void 0),$l([Es({attribute:"accent-foreground-rest-delta",converter:$s}),rp(Xc)],sp.prototype,"accentForegroundRestDelta",void 0),$l([Es({attribute:"accent-foreground-hover-delta",converter:$s}),rp(Yc)],sp.prototype,"accentForegroundHoverDelta",void 0),$l([Es({attribute:"accent-foreground-active-delta",converter:$s}),rp(Qc)],sp.prototype,"accentForegroundActiveDelta",void 0),$l([Es({attribute:"accent-foreground-focus-delta",converter:$s}),rp(Zc)],sp.prototype,"accentForegroundFocusDelta",void 0),$l([Es({attribute:"neutral-fill-rest-delta",converter:$s}),rp(Jc)],sp.prototype,"neutralFillRestDelta",void 0),$l([Es({attribute:"neutral-fill-hover-delta",converter:$s}),rp(ed)],sp.prototype,"neutralFillHoverDelta",void 0),$l([Es({attribute:"neutral-fill-active-delta",converter:$s}),rp(td)],sp.prototype,"neutralFillActiveDelta",void 0),$l([Es({attribute:"neutral-fill-focus-delta",converter:$s}),rp(id)],sp.prototype,"neutralFillFocusDelta",void 0),$l([Es({attribute:"neutral-fill-input-rest-delta",converter:$s}),rp(od)],sp.prototype,"neutralFillInputRestDelta",void 0),$l([Es({attribute:"neutral-fill-input-hover-delta",converter:$s}),rp(nd)],sp.prototype,"neutralFillInputHoverDelta",void 0),$l([Es({attribute:"neutral-fill-input-active-delta",converter:$s}),rp(rd)],sp.prototype,"neutralFillInputActiveDelta",void 0),$l([Es({attribute:"neutral-fill-input-focus-delta",converter:$s}),rp(sd)],sp.prototype,"neutralFillInputFocusDelta",void 0),$l([Es({attribute:"neutral-fill-stealth-rest-delta",converter:$s}),rp(ad)],sp.prototype,"neutralFillStealthRestDelta",void 0),$l([Es({attribute:"neutral-fill-stealth-hover-delta",converter:$s}),rp(ld)],sp.prototype,"neutralFillStealthHoverDelta",void 0),$l([Es({attribute:"neutral-fill-stealth-active-delta",converter:$s}),rp(cd)],sp.prototype,"neutralFillStealthActiveDelta",void 0),$l([Es({attribute:"neutral-fill-stealth-focus-delta",converter:$s}),rp(dd)],sp.prototype,"neutralFillStealthFocusDelta",void 0),$l([Es({attribute:"neutral-fill-strong-hover-delta",converter:$s}),rp(ud)],sp.prototype,"neutralFillStrongHoverDelta",void 0),$l([Es({attribute:"neutral-fill-strong-active-delta",converter:$s}),rp(pd)],sp.prototype,"neutralFillStrongActiveDelta",void 0),$l([Es({attribute:"neutral-fill-strong-focus-delta",converter:$s}),rp(gd)],sp.prototype,"neutralFillStrongFocusDelta",void 0),$l([Es({attribute:"base-layer-luminance",converter:$s}),rp(yc)],sp.prototype,"baseLayerLuminance",void 0),$l([Es({attribute:"neutral-fill-layer-rest-delta",converter:$s}),rp(fd)],sp.prototype,"neutralFillLayerRestDelta",void 0),$l([Es({attribute:"neutral-stroke-divider-rest-delta",converter:$s}),rp(wd)],sp.prototype,"neutralStrokeDividerRestDelta",void 0),$l([Es({attribute:"neutral-stroke-rest-delta",converter:$s}),rp(vd)],sp.prototype,"neutralStrokeRestDelta",void 0),$l([Es({attribute:"neutral-stroke-hover-delta",converter:$s}),rp(bd)],sp.prototype,"neutralStrokeHoverDelta",void 0),$l([Es({attribute:"neutral-stroke-active-delta",converter:$s}),rp(md)],sp.prototype,"neutralStrokeActiveDelta",void 0),$l([Es({attribute:"neutral-stroke-focus-delta",converter:$s}),rp(yd)],sp.prototype,"neutralStrokeFocusDelta",void 0);const ap=sp.compose({baseName:"design-system-provider",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("block")} `});var lp=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],cp=lp.join(","),dp="undefined"==typeof Element,hp=dp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,up=!dp&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},pp=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},gp=function(e){return"INPUT"===e.tagName},fp=function(e){return function(e){return gp(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,i=e.form||up(e),o=function(e){return i.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var n=function(e,t){for(var i=0;isummary:first-of-type")?e.parentElement:e;if(hp.call(n,"details:not([open]) *"))return!0;var r=up(e).host,s=(null==r?void 0:r.ownerDocument.contains(r))||e.ownerDocument.contains(e);if(i&&"full"!==i){if("non-zero-area"===i)return vp(e)}else{if("function"==typeof o){for(var a=e;e;){var l=e.parentElement,c=up(e);if(l&&!l.shadowRoot&&!0===o(l))return vp(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=a}if(s)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var i=0;i{this.$fastController.isConnected&&this.updateTrapFocus()},this.isTrappingFocus=!1,this.handleDocumentKeydown=e=>{if(!e.defaultPrevented&&!this.hidden)switch(e.key){case vu:this.dismiss(),e.preventDefault();break;case wu:this.handleTabKeyDown(e)}},this.handleDocumentFocus=e=>{!e.defaultPrevented&&this.shouldForceFocus(e.target)&&(this.focusFirstElement(),e.preventDefault())},this.handleTabKeyDown=e=>{if(!this.trapFocus||this.hidden)return;const t=this.getTabQueueBounds();return 0!==t.length?1===t.length?(t[0].focus(),void e.preventDefault()):void(e.shiftKey&&e.target===t[0]?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||e.target!==t[t.length-1]||(t[0].focus(),e.preventDefault())):void 0},this.getTabQueueBounds=()=>wp.reduceTabbableItems([],this),this.focusFirstElement=()=>{const e=this.getTabQueueBounds();e.length>0?e[0].focus():this.dialog instanceof HTMLElement&&this.dialog.focus()},this.shouldForceFocus=e=>this.isTrappingFocus&&!this.contains(e),this.shouldTrapFocus=()=>this.trapFocus&&!this.hidden,this.updateTrapFocus=e=>{const t=void 0===e?this.shouldTrapFocus():e;t&&!this.isTrappingFocus?(this.isTrappingFocus=!0,document.addEventListener("focusin",this.handleDocumentFocus),Or.queueUpdate((()=>{this.shouldForceFocus(document.activeElement)&&this.focusFirstElement()}))):!t&&this.isTrappingFocus&&(this.isTrappingFocus=!1,document.removeEventListener("focusin",this.handleDocumentFocus))}}dismiss(){this.$emit("dismiss"),this.$emit("cancel")}show(){this.hidden=!1}hide(){this.hidden=!0,this.$emit("close")}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleDocumentKeydown),this.notifier=zr.getNotifier(this),this.notifier.subscribe(this,"hidden"),this.updateTrapFocus()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleDocumentKeydown),this.updateTrapFocus(!1),this.notifier.unsubscribe(this,"hidden")}handleChange(e,t){if("hidden"===t)this.updateTrapFocus()}static reduceTabbableItems(e,t){return"-1"===t.getAttribute("tabindex")?e:yp(t)||wp.isFocusableFastElement(t)&&wp.hasTabbableShadow(t)?(e.push(t),e):t.childElementCount?e.concat(Array.from(t.children).reduce(wp.reduceTabbableItems,[])):e}static isFocusableFastElement(e){var t,i;return!!(null===(i=null===(t=e.$fastController)||void 0===t?void 0:t.definition.shadowOptions)||void 0===i?void 0:i.delegatesFocus)}static hasTabbableShadow(e){var t,i;return Array.from(null!==(i=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelectorAll("*"))&&void 0!==i?i:[]).some((e=>yp(e)))}}$l([Es({mode:"boolean"})],wp.prototype,"modal",void 0),$l([Es({mode:"boolean"})],wp.prototype,"hidden",void 0),$l([Es({attribute:"trap-focus",mode:"boolean"})],wp.prototype,"trapFocus",void 0),$l([Es({attribute:"aria-describedby"})],wp.prototype,"ariaDescribedby",void 0),$l([Es({attribute:"aria-labelledby"})],wp.prototype,"ariaLabelledby",void 0),$l([Es({attribute:"aria-label"})],wp.prototype,"ariaLabel",void 0);const xp=`box-shadow: ${"0 0 calc((var(--elevation) * 0.225px) + 2px) rgba(0, 0, 0, calc(.11 * (2 - var(--background-luminance, 1))))"}, ${"0 calc(var(--elevation) * 0.4px) calc((var(--elevation) * 0.9px)) rgba(0, 0, 0, calc(.13 * (2 - var(--background-luminance, 1))))"};`,kp=wp.compose({baseName:"dialog",template:(e,t)=>ws`
${xs((e=>e.modal),ws` `)}
`,styles:(e,t)=>Br` :host([hidden]) { display: none; } :host { --elevation: 14; --dialog-height: 480px; --dialog-width: 640px; display: block; } .overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.3); touch-action: none; } .positioning-region { display: flex; justify-content: center; position: fixed; top: 0; bottom: 0; left: 0; right: 0; overflow: auto; } .control { ${xp} margin-top: auto; margin-bottom: auto; width: var(--dialog-width); height: var(--dialog-height); background-color: ${Pd}; z-index: 1; border-radius: calc(${wc} * 1px); border: calc(${$c} * 1px) solid transparent; } `}),Sp="horizontal",Cp="separator";class $p extends Hh{constructor(){super(...arguments),this.role=Cp,this.orientation=Sp}}$l([Es],$p.prototype,"role",void 0),$l([Es],$p.prototype,"orientation",void 0);const Np=$p.compose({baseName:"divider",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("block")} :host { box-sizing: content-box; height: 0; margin: calc(${kc} * 1px) 0; border-top: calc(${$c} * 1px) solid ${Lh}; border-left: none; } :host([orientation="vertical"]) { height: 100%; margin: 0 calc(${kc} * 1px); border-top: none; border-left: calc(${$c} * 1px) solid ${Lh}; } `}),Ep="menuitem",Lp="menuitemcheckbox",Tp="menuitemradio",Op={[Ep]:"menuitem",[Lp]:"menuitemcheckbox",[Tp]:"menuitemradio"};class _p extends Hh{constructor(){super(...arguments),this.role=Ep,this.hasSubmenu=!1,this.currentDirection=Ul.ltr,this.focusSubmenuOnLoad=!1,this.handleMenuItemKeyDown=e=>{if(e.defaultPrevented)return!1;switch(e.key){case fu:case yu:return this.invoke(),!1;case pu:return this.expandAndFocus(),!1;case uu:if(this.expanded)return this.expanded=!1,this.focus(),!1}return!0},this.handleMenuItemClick=e=>(e.defaultPrevented||this.disabled||this.invoke(),!1),this.submenuLoaded=()=>{this.focusSubmenuOnLoad&&(this.focusSubmenuOnLoad=!1,this.hasSubmenu&&(this.submenu.focus(),this.setAttribute("tabindex","-1")))},this.handleMouseOver=e=>(this.disabled||!this.hasSubmenu||this.expanded||(this.expanded=!0),!1),this.handleMouseOut=e=>(!this.expanded||this.contains(document.activeElement)||(this.expanded=!1),!1),this.expandAndFocus=()=>{this.hasSubmenu&&(this.focusSubmenuOnLoad=!0,this.expanded=!0)},this.invoke=()=>{if(!this.disabled)switch(this.role){case Lp:this.checked=!this.checked;break;case Ep:this.updateSubmenu(),this.hasSubmenu?this.expandAndFocus():this.$emit("change");break;case Tp:this.checked||(this.checked=!0)}},this.updateSubmenu=()=>{this.submenu=this.domChildren().find((e=>"menu"===e.getAttribute("role"))),this.hasSubmenu=void 0!==this.submenu}}expandedChanged(e){if(this.$fastController.isConnected){if(void 0===this.submenu)return;!1===this.expanded?this.submenu.collapseExpandedItem():this.currentDirection=iu(this),this.$emit("expanded-change",this,{bubbles:!1})}}checkedChanged(e,t){this.$fastController.isConnected&&this.$emit("change")}connectedCallback(){super.connectedCallback(),Or.queueUpdate((()=>{this.updateSubmenu()})),this.startColumnCount||(this.startColumnCount=1),this.observer=new MutationObserver(this.updateSubmenu)}disconnectedCallback(){super.disconnectedCallback(),this.submenu=void 0,void 0!==this.observer&&(this.observer.disconnect(),this.observer=void 0)}domChildren(){return Array.from(this.children).filter((e=>!e.hasAttribute("hidden")))}}$l([Es({mode:"boolean"})],_p.prototype,"disabled",void 0),$l([Es({mode:"boolean"})],_p.prototype,"expanded",void 0),$l([Hr],_p.prototype,"startColumnCount",void 0),$l([Es],_p.prototype,"role",void 0),$l([Es({mode:"boolean"})],_p.prototype,"checked",void 0),$l([Hr],_p.prototype,"submenuRegion",void 0),$l([Hr],_p.prototype,"hasSubmenu",void 0),$l([Hr],_p.prototype,"currentDirection",void 0),$l([Hr],_p.prototype,"submenu",void 0),cu(_p,su);class Ip extends Hh{constructor(){super(...arguments),this.expandedItem=null,this.focusIndex=-1,this.isNestedMenu=()=>null!==this.parentElement&&Vu(this.parentElement)&&"menuitem"===this.parentElement.getAttribute("role"),this.handleFocusOut=e=>{if(!this.contains(e.relatedTarget)&&void 0!==this.menuItems){this.collapseExpandedItem();const e=this.menuItems.findIndex(this.isFocusableElement);this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.menuItems[e].setAttribute("tabindex","0"),this.focusIndex=e}},this.handleItemFocus=e=>{const t=e.target;void 0!==this.menuItems&&t!==this.menuItems[this.focusIndex]&&(this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=this.menuItems.indexOf(t),t.setAttribute("tabindex","0"))},this.handleExpandedChanged=e=>{if(e.defaultPrevented||null===e.target||void 0===this.menuItems||this.menuItems.indexOf(e.target)<0)return;e.preventDefault();const t=e.target;null===this.expandedItem||t!==this.expandedItem||!1!==t.expanded?t.expanded&&(null!==this.expandedItem&&this.expandedItem!==t&&(this.expandedItem.expanded=!1),this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.expandedItem=t,this.focusIndex=this.menuItems.indexOf(t),t.setAttribute("tabindex","0")):this.expandedItem=null},this.removeItemListeners=()=>{void 0!==this.menuItems&&this.menuItems.forEach((e=>{e.removeEventListener("expanded-change",this.handleExpandedChanged),e.removeEventListener("focus",this.handleItemFocus)}))},this.setItems=()=>{const e=this.domChildren();this.removeItemListeners(),this.menuItems=e;const t=this.menuItems.filter(this.isMenuItemElement);t.length&&(this.focusIndex=0);const i=t.reduce(((e,t)=>{const i=function(e){const t=e.getAttribute("role"),i=e.querySelector("[slot=start]");return t!==Ep&&null===i||t===Ep&&null!==i?1:t!==Ep&&null!==i?2:0}(t);return e>i?e:i}),0);t.forEach(((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),e.addEventListener("expanded-change",this.handleExpandedChanged),e.addEventListener("focus",this.handleItemFocus),e instanceof _p&&(e.startColumnCount=i)}))},this.changeHandler=e=>{if(void 0===this.menuItems)return;const t=e.target,i=this.menuItems.indexOf(t);if(-1!==i&&"menuitemradio"===t.role&&!0===t.checked){for(let e=i-1;e>=0;--e){const t=this.menuItems[e],i=t.getAttribute("role");if(i===Tp&&(t.checked=!1),"separator"===i)break}const e=this.menuItems.length-1;for(let t=i+1;t<=e;++t){const e=this.menuItems[t],i=e.getAttribute("role");if(i===Tp&&(e.checked=!1),"separator"===i)break}}},this.isMenuItemElement=e=>Vu(e)&&Ip.focusableElementRoles.hasOwnProperty(e.getAttribute("role")),this.isFocusableElement=e=>this.isMenuItemElement(e)}itemsChanged(e,t){this.$fastController.isConnected&&void 0!==this.menuItems&&this.setItems()}connectedCallback(){super.connectedCallback(),Or.queueUpdate((()=>{this.setItems()})),this.addEventListener("change",this.changeHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeItemListeners(),this.menuItems=void 0,this.removeEventListener("change",this.changeHandler)}focus(){this.setFocus(0,1)}collapseExpandedItem(){null!==this.expandedItem&&(this.expandedItem.expanded=!1,this.expandedItem=null)}handleMenuKeyDown(e){if(!e.defaultPrevented&&void 0!==this.menuItems)switch(e.key){case hu:return void this.setFocus(this.focusIndex+1,1);case gu:return void this.setFocus(this.focusIndex-1,-1);case mu:return void this.setFocus(this.menuItems.length-1,-1);case bu:return void this.setFocus(0,1);default:return!0}}domChildren(){return Array.from(this.children).filter((e=>!e.hasAttribute("hidden")))}setFocus(e,t){if(void 0!==this.menuItems)for(;e>=0&&e-1&&this.menuItems.length>=this.focusIndex-1&&this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=e,i.setAttribute("tabindex","0"),i.focus();break}e+=t}}}Ip.focusableElementRoles=Op,$l([Hr],Ip.prototype,"items",void 0);const Dp=class extends Ip{connectedCallback(){super.connectedCallback(),Pd.setValueFor(this,Ed)}}.compose({baseName:"menu",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("block")} :host { --elevation: 11; background: ${Pd}; border: calc(${$c} * 1px) solid transparent; ${xp} margin: 0; border-radius: calc(${wc} * 1px); padding: calc(${kc} * 1px) 0; max-width: 368px; min-width: 64px; } :host([slot="submenu"]) { width: max-content; margin: 0 calc(${kc} * 1px); } ::slotted(hr) { box-sizing: content-box; height: 0; margin: 0; border: none; border-top: calc(${$c} * 1px) solid ${Lh}; } `.withBehaviors(Au(Br` :host { background: ${Fu.Canvas}; border-color: ${Fu.CanvasText}; } `))});class Rp{constructor(e,t){this.cache=new WeakMap,this.ltr=e,this.rtl=t}bind(e){this.attach(e)}unbind(e){const t=this.cache.get(e);t&&Sc.unsubscribe(t)}attach(e){const t=this.cache.get(e)||new Pp(this.ltr,this.rtl,e),i=Sc.getValueFor(e);Sc.subscribe(t),t.attach(i),this.cache.set(e,t)}}class Pp{constructor(e,t,i){this.ltr=e,this.rtl=t,this.source=i,this.attached=null}handleChange({target:e,token:t}){this.attach(t.getValueFor(e))}attach(e){this.attached!==this[e]&&(null!==this.attached&&this.source.$fastController.removeStyles(this.attached),this.attached=this[e],null!==this.attached&&this.source.$fastController.addStyles(this.attached))}}const Ap=_p.compose({baseName:"menu-item",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("grid")} :host { contain: layout; overflow: visible; font-family: ${vc}; outline: none; box-sizing: border-box; height: calc(${Hu} * 1px); grid-template-columns: minmax(42px, auto) 1fr minmax(42px, auto); grid-template-rows: auto; justify-items: center; align-items: center; padding: 0; margin: 0 calc(${kc} * 1px); white-space: nowrap; background: ${ch}; color: ${kh}; fill: currentcolor; cursor: pointer; font-size: ${Ec}; line-height: ${Lc}; border-radius: calc(${wc} * 1px); border: calc(${Nc} * 1px) solid transparent; } :host(:hover) { position: relative; z-index: 1; } :host(.indent-0) { grid-template-columns: auto 1fr minmax(42px, auto); } :host(.indent-0) .content { grid-column: 1; grid-row: 1; margin-inline-start: 10px; } :host(.indent-0) .expand-collapse-glyph-container { grid-column: 5; grid-row: 1; } :host(.indent-2) { grid-template-columns: minmax(42px, auto) minmax(42px, auto) 1fr minmax(42px, auto) minmax(42px, auto); } :host(.indent-2) .content { grid-column: 3; grid-row: 1; margin-inline-start: 10px; } :host(.indent-2) .expand-collapse-glyph-container { grid-column: 5; grid-row: 1; } :host(.indent-2) .start { grid-column: 2; } :host(.indent-2) .end { grid-column: 4; } :host(:${zu}) { border-color: ${vh}; background: ${uh}; color: ${kh}; } :host(:hover) { background: ${dh}; color: ${kh}; } :host(:active) { background: ${hh}; } :host([aria-checked="true"]), :host(.expanded) { background: ${th}; color: ${kh}; } :host([disabled]) { cursor: ${Ru}; opacity: ${Cc}; } :host([disabled]:hover) { color: ${kh}; fill: currentcolor; background: ${ch}; } :host([disabled]:hover) .start, :host([disabled]:hover) .end, :host([disabled]:hover)::slotted(svg) { fill: ${kh}; } .expand-collapse-glyph { /* TODO: adaptive typography https://github.com/microsoft/fast/issues/2432 */ width: 16px; height: 16px; fill: currentcolor; } .content { grid-column-start: 2; justify-self: start; overflow: hidden; text-overflow: ellipsis; } .start, .end { display: flex; justify-content: center; } ::slotted(svg) { /* TODO: adaptive typography https://github.com/microsoft/fast/issues/2432 */ width: 16px; height: 16px; } :host(:hover) .start, :host(:hover) .end, :host(:hover)::slotted(svg), :host(:active) .start, :host(:active) .end, :host(:active)::slotted(svg) { fill: ${kh}; } :host(.indent-0[aria-haspopup="menu"]) { display: grid; grid-template-columns: minmax(42px, auto) auto 1fr minmax(42px, auto) minmax(42px, auto); align-items: center; min-height: 32px; } :host(.indent-1[aria-haspopup="menu"]), :host(.indent-1[role="menuitemcheckbox"]), :host(.indent-1[role="menuitemradio"]) { display: grid; grid-template-columns: minmax(42px, auto) auto 1fr minmax(42px, auto) minmax(42px, auto); align-items: center; min-height: 32px; } :host(.indent-2:not([aria-haspopup="menu"])) .end { grid-column: 5; } :host .input-container, :host .expand-collapse-glyph-container { display: none; } :host([aria-haspopup="menu"]) .expand-collapse-glyph-container, :host([role="menuitemcheckbox"]) .input-container, :host([role="menuitemradio"]) .input-container { display: grid; margin-inline-end: 10px; } :host([aria-haspopup="menu"]) .content, :host([role="menuitemcheckbox"]) .content, :host([role="menuitemradio"]) .content { grid-column-start: 3; } :host([aria-haspopup="menu"].indent-0) .content { grid-column-start: 1; } :host([aria-haspopup="menu"]) .end, :host([role="menuitemcheckbox"]) .end, :host([role="menuitemradio"]) .end { grid-column-start: 4; } :host .expand-collapse, :host .checkbox, :host .radio { display: flex; align-items: center; justify-content: center; position: relative; width: 20px; height: 20px; box-sizing: border-box; outline: none; margin-inline-start: 10px; } :host .checkbox, :host .radio { border: calc(${$c} * 1px) solid ${kh}; } :host([aria-checked="true"]) .checkbox, :host([aria-checked="true"]) .radio { background: ${Bd}; border-color: ${Bd}; } :host .checkbox { border-radius: calc(${wc} * 1px); } :host .radio { border-radius: 999px; } :host .checkbox-indicator, :host .radio-indicator, :host .expand-collapse-indicator, ::slotted([slot="checkbox-indicator"]), ::slotted([slot="radio-indicator"]), ::slotted([slot="expand-collapse-indicator"]) { display: none; } ::slotted([slot="end"]:not(svg)) { margin-inline-end: 10px; color: ${wh} } :host([aria-checked="true"]) .checkbox-indicator, :host([aria-checked="true"]) ::slotted([slot="checkbox-indicator"]) { width: 100%; height: 100%; display: block; fill: ${Ud}; pointer-events: none; } :host([aria-checked="true"]) .radio-indicator { position: absolute; top: 4px; left: 4px; right: 4px; bottom: 4px; border-radius: 999px; display: block; background: ${Ud}; pointer-events: none; } :host([aria-checked="true"]) ::slotted([slot="radio-indicator"]) { display: block; pointer-events: none; } `.withBehaviors(Au(Br` :host { border-color: transparent; color: ${Fu.ButtonText}; forced-color-adjust: none; } :host(:hover) { background: ${Fu.Highlight}; color: ${Fu.HighlightText}; } :host(:hover) .start, :host(:hover) .end, :host(:hover)::slotted(svg), :host(:active) .start, :host(:active) .end, :host(:active)::slotted(svg) { fill: ${Fu.HighlightText}; } :host(.expanded) { background: ${Fu.Highlight}; border-color: ${Fu.Highlight}; color: ${Fu.HighlightText}; } :host(:${zu}) { background: ${Fu.Highlight}; border-color: ${Fu.ButtonText}; box-shadow: 0 0 0 calc(${Nc} * 1px) inset ${Fu.HighlightText}; color: ${Fu.HighlightText}; fill: currentcolor; } :host([disabled]), :host([disabled]:hover), :host([disabled]:hover) .start, :host([disabled]:hover) .end, :host([disabled]:hover)::slotted(svg) { background: ${Fu.Canvas}; color: ${Fu.GrayText}; fill: currentcolor; opacity: 1; } :host .expanded-toggle, :host .checkbox, :host .radio{ border-color: ${Fu.ButtonText}; background: ${Fu.HighlightText}; } :host([checked="true"]) .checkbox, :host([checked="true"]) .radio { background: ${Fu.HighlightText}; border-color: ${Fu.HighlightText}; } :host(:hover) .expanded-toggle, :host(:hover) .checkbox, :host(:hover) .radio, :host(:${zu}) .expanded-toggle, :host(:${zu}) .checkbox, :host(:${zu}) .radio, :host([checked="true"]:hover) .checkbox, :host([checked="true"]:hover) .radio, :host([checked="true"]:${zu}) .checkbox, :host([checked="true"]:${zu}) .radio { border-color: ${Fu.HighlightText}; } :host([aria-checked="true"]) { background: ${Fu.Highlight}; color: ${Fu.HighlightText}; } :host([aria-checked="true"]) .checkbox-indicator, :host([aria-checked="true"]) ::slotted([slot="checkbox-indicator"]), :host([aria-checked="true"]) ::slotted([slot="radio-indicator"]) { fill: ${Fu.Highlight}; } :host([aria-checked="true"]) .radio-indicator { background: ${Fu.Highlight}; } ::slotted([slot="end"]:not(svg)) { color: ${Fu.ButtonText}; } :host(:hover) ::slotted([slot="end"]:not(svg)), :host(:${zu}) ::slotted([slot="end"]:not(svg)) { color: ${Fu.HighlightText}; } `),new Rp(Br` .expand-collapse-glyph { transform: rotate(0deg); } `,Br` .expand-collapse-glyph { transform: rotate(180deg); } `)),checkboxIndicator:`\n \n \n \n `,expandCollapseGlyph:`\n \n \n \n `,radioIndicator:`\n \n `});function Fp(e){return Vu(e)&&("option"===e.getAttribute("role")||e instanceof HTMLOptionElement)}class Bp extends Hh{constructor(e,t,i,o){super(),this.defaultSelected=!1,this.dirtySelected=!1,this.selected=this.defaultSelected,this.dirtyValue=!1,e&&(this.textContent=e),t&&(this.initialValue=t),i&&(this.defaultSelected=i),o&&(this.selected=o),this.proxy=new Option(`${this.textContent}`,this.initialValue,this.defaultSelected,this.selected),this.proxy.disabled=this.disabled}checkedChanged(e,t){this.ariaChecked="boolean"!=typeof t?null:t?"true":"false"}contentChanged(e,t){this.proxy instanceof HTMLOptionElement&&(this.proxy.textContent=this.textContent),this.$emit("contentchange",null,{bubbles:!0})}defaultSelectedChanged(){this.dirtySelected||(this.selected=this.defaultSelected,this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.defaultSelected))}disabledChanged(e,t){this.ariaDisabled=this.disabled?"true":"false",this.proxy instanceof HTMLOptionElement&&(this.proxy.disabled=this.disabled)}selectedAttributeChanged(){this.defaultSelected=this.selectedAttribute,this.proxy instanceof HTMLOptionElement&&(this.proxy.defaultSelected=this.defaultSelected)}selectedChanged(){this.ariaSelected=this.selected?"true":"false",this.dirtySelected||(this.dirtySelected=!0),this.proxy instanceof HTMLOptionElement&&(this.proxy.selected=this.selected)}initialValueChanged(e,t){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}get label(){var e;return null!==(e=this.value)&&void 0!==e?e:this.text}get text(){var e,t;return null!==(t=null===(e=this.textContent)||void 0===e?void 0:e.replace(/\s+/g," ").trim())&&void 0!==t?t:""}set value(e){const t=`${null!=e?e:""}`;this._value=t,this.dirtyValue=!0,this.proxy instanceof HTMLOptionElement&&(this.proxy.value=t),zr.notify(this,"value")}get value(){var e;return zr.track(this,"value"),null!==(e=this._value)&&void 0!==e?e:this.text}get form(){return this.proxy?this.proxy.form:null}}$l([Hr],Bp.prototype,"checked",void 0),$l([Hr],Bp.prototype,"content",void 0),$l([Hr],Bp.prototype,"defaultSelected",void 0),$l([Es({mode:"boolean"})],Bp.prototype,"disabled",void 0),$l([Es({attribute:"selected",mode:"boolean"})],Bp.prototype,"selectedAttribute",void 0),$l([Hr],Bp.prototype,"selected",void 0),$l([Es({attribute:"value",mode:"fromView"})],Bp.prototype,"initialValue",void 0);class Mp{}$l([Hr],Mp.prototype,"ariaChecked",void 0),$l([Hr],Mp.prototype,"ariaPosInSet",void 0),$l([Hr],Mp.prototype,"ariaSelected",void 0),$l([Hr],Mp.prototype,"ariaSetSize",void 0),cu(Mp,ru),cu(Bp,su,Mp);const Vp=Bp.compose({baseName:"option",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("inline-flex")} :host { align-items: center; font-family: ${vc}; border-radius: calc(${wc} * 1px); border: calc(${Nc} * 1px) solid transparent; box-sizing: border-box; background: ${ch}; color: ${kh}; cursor: pointer; flex: 0 0 auto; fill: currentcolor; font-size: ${Ec}; height: calc(${Hu} * 1px); line-height: ${Lc}; margin: 0 calc((${kc} - ${Nc}) * 1px); outline: none; overflow: hidden; padding: 0 1ch; user-select: none; white-space: nowrap; } :host(:not([disabled]):not([aria-selected="true"]):hover) { background: ${dh}; } :host(:not([disabled]):not([aria-selected="true"]):active) { background: ${hh}; } :host([aria-selected="true"]) { background: ${Bd}; color: ${Ud}; } :host(:not([disabled])[aria-selected="true"]:hover) { background: ${Md}; color: ${qd}; } :host(:not([disabled])[aria-selected="true"]:active) { background: ${Vd}; color: ${Kd}; } :host([disabled]) { cursor: ${Ru}; opacity: ${Cc}; } .content { grid-column-start: 2; justify-self: start; overflow: hidden; text-overflow: ellipsis; } .start, .end, ::slotted(svg) { display: flex; } ::slotted(svg) { /* TODO: adaptive typography https://github.com/microsoft/fast/issues/2432 */ height: calc(${kc} * 4px); width: calc(${kc} * 4px); } ::slotted([slot="end"]) { margin-inline-start: 1ch; } ::slotted([slot="start"]) { margin-inline-end: 1ch; } :host([aria-checked="true"][aria-selected="false"]) { border-color: ${vh}; } :host([aria-checked="true"][aria-selected="true"]) { border-color: ${vh}; box-shadow: 0 0 0 calc(${Nc} * 2 * 1px) inset ${mh}; } `.withBehaviors(Au(Br` :host { border-color: transparent; forced-color-adjust: none; color: ${Fu.ButtonText}; fill: currentcolor; } :host(:not([aria-selected="true"]):hover), :host([aria-selected="true"]) { background: ${Fu.Highlight}; color: ${Fu.HighlightText}; } :host([disabled]), :host([disabled][aria-selected="false"]:hover) { background: ${Fu.Canvas}; color: ${Fu.GrayText}; fill: currentcolor; opacity: 1; } :host([aria-checked="true"][aria-selected="false"]) { background: ${Fu.ButtonFace}; color: ${Fu.ButtonText}; border-color: ${Fu.ButtonText}; } :host([aria-checked="true"][aria-selected="true"]), :host([aria-checked="true"][aria-selected="true"]:hover) { background: ${Fu.Highlight}; color: ${Fu.HighlightText}; border-color: ${Fu.ButtonText}; } `))});class jp extends Hh{}class zp extends(Eu(jp)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class Hp extends zp{constructor(){super(),this.initialValue="on",this.keypressHandler=e=>{if(e.key!==yu)return!0;this.checked||this.readOnly||(this.checked=!0)},this.proxy.setAttribute("type","radio")}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly)}defaultCheckedChanged(){var e;this.$fastController.isConnected&&!this.dirtyChecked&&(this.isInsideRadioGroup()||(this.checked=null!==(e=this.defaultChecked)&&void 0!==e&&e,this.dirtyChecked=!1))}connectedCallback(){var e,t;super.connectedCallback(),this.validate(),"radiogroup"!==(null===(e=this.parentElement)||void 0===e?void 0:e.getAttribute("role"))&&null===this.getAttribute("tabindex")&&(this.disabled||this.setAttribute("tabindex","0")),this.checkedAttribute&&(this.dirtyChecked||this.isInsideRadioGroup()||(this.checked=null!==(t=this.defaultChecked)&&void 0!==t&&t,this.dirtyChecked=!1))}isInsideRadioGroup(){return null!==this.closest("[role=radiogroup]")}clickHandler(e){this.disabled||this.readOnly||this.checked||(this.checked=!0)}}$l([Es({attribute:"readonly",mode:"boolean"})],Hp.prototype,"readOnly",void 0),$l([Hr],Hp.prototype,"name",void 0),$l([Hr],Hp.prototype,"defaultSlottedNodes",void 0);const Up=Hp.compose({baseName:"radio",template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("inline-flex")} :host { --input-size: calc((${Hu} / 2) + ${kc}); align-items: center; outline: none; margin: calc(${kc} * 1px) 0; /* Chromium likes to select label text or the default slot when the radio is clicked. Maybe there is a better solution here? */ user-select: none; position: relative; flex-direction: row; transition: all 0.2s ease-in-out; } .control { position: relative; width: calc((${Hu} / 2 + ${kc}) * 1px); height: calc((${Hu} / 2 + ${kc}) * 1px); box-sizing: border-box; border-radius: 999px; border: calc(${$c} * 1px) solid ${Ch}; background: ${rh}; outline: none; cursor: pointer; } .label { font-family: ${vc}; color: ${kh}; padding-inline-start: calc(${kc} * 2px + 2px); margin-inline-end: calc(${kc} * 2px + 2px); cursor: pointer; font-size: ${Ec}; line-height: ${Lc}; } .label__hidden { display: none; visibility: hidden; } .control, .checked-indicator { flex-shrink: 0; } .checked-indicator { position: absolute; top: 5px; left: 5px; right: 5px; bottom: 5px; border-radius: 999px; display: inline-block; background: ${Ud}; fill: ${Ud}; opacity: 0; pointer-events: none; } :host(:not([disabled])) .control:hover{ background: ${sh}; border-color: ${$h}; } :host(:not([disabled])) .control:active { background: ${ah}; border-color: ${Nh}; } :host(:${zu}) .control { box-shadow: 0 0 0 2px ${Pd}, 0 0 0 4px ${vh}; } :host([aria-checked="true"]) .control { background: ${Bd}; border: calc(${$c} * 1px) solid ${Bd}; } :host([aria-checked="true"]:not([disabled])) .control:hover { background: ${Md}; border: calc(${$c} * 1px) solid ${Md}; } :host([aria-checked="true"]:not([disabled])) .control:hover .checked-indicator { background: ${qd}; fill: ${qd}; } :host([aria-checked="true"]:not([disabled])) .control:active { background: ${Vd}; border: calc(${$c} * 1px) solid ${Vd}; } :host([aria-checked="true"]:not([disabled])) .control:active .checked-indicator { background: ${Kd}; fill: ${Kd}; } :host([aria-checked="true"]:${zu}:not([disabled])) .control { box-shadow: 0 0 0 2px ${Pd}, 0 0 0 4px ${vh}; } :host([disabled]) .label, :host([readonly]) .label, :host([readonly]) .control, :host([disabled]) .control { cursor: ${Ru}; } :host([aria-checked="true"]) .checked-indicator { opacity: 1; } :host([disabled]) { opacity: ${Cc}; } `.withBehaviors(Au(Br` .control, :host([aria-checked="true"]:not([disabled])) .control { forced-color-adjust: none; border-color: ${Fu.FieldText}; background: ${Fu.Field}; } :host(:not([disabled])) .control:hover { border-color: ${Fu.Highlight}; background: ${Fu.Field}; } :host([aria-checked="true"]:not([disabled])) .control:hover, :host([aria-checked="true"]:not([disabled])) .control:active { border-color: ${Fu.Highlight}; background: ${Fu.Highlight}; } :host([aria-checked="true"]) .checked-indicator { background: ${Fu.Highlight}; fill: ${Fu.Highlight}; } :host([aria-checked="true"]:not([disabled])) .control:hover .checked-indicator, :host([aria-checked="true"]:not([disabled])) .control:active .checked-indicator { background: ${Fu.HighlightText}; fill: ${Fu.HighlightText}; } :host(:${zu}) .control { border-color: ${Fu.Highlight}; box-shadow: 0 0 0 2px ${Fu.Field}, 0 0 0 4px ${Fu.FieldText}; } :host([aria-checked="true"]:${zu}:not([disabled])) .control { border-color: ${Fu.Highlight}; box-shadow: 0 0 0 2px ${Fu.Field}, 0 0 0 4px ${Fu.FieldText}; } :host([disabled]) { forced-color-adjust: none; opacity: 1; } :host([disabled]) .label { color: ${Fu.GrayText}; } :host([disabled]) .control, :host([aria-checked="true"][disabled]) .control:hover, .control:active { background: ${Fu.Field}; border-color: ${Fu.GrayText}; } :host([disabled]) .checked-indicator, :host([aria-checked="true"][disabled]) .control:hover .checked-indicator { fill: ${Fu.GrayText}; background: ${Fu.GrayText}; } `)),checkedIndicator:`\n
\n `});class qp extends Hh{constructor(){super(...arguments),this.orientation=Sp,this.radioChangeHandler=e=>{const t=e.target;t.checked&&(this.slottedRadioButtons.forEach((e=>{e!==t&&(e.checked=!1,this.isInsideFoundationToolbar||e.setAttribute("tabindex","-1"))})),this.selectedRadio=t,this.value=t.value,t.setAttribute("tabindex","0"),this.focusedRadio=t),e.stopPropagation()},this.moveToRadioByIndex=(e,t)=>{const i=e[t];this.isInsideToolbar||(i.setAttribute("tabindex","0"),i.readOnly?this.slottedRadioButtons.forEach((e=>{e!==i&&e.setAttribute("tabindex","-1")})):(i.checked=!0,this.selectedRadio=i)),this.focusedRadio=i,i.focus()},this.moveRightOffGroup=()=>{var e;null===(e=this.nextElementSibling)||void 0===e||e.focus()},this.moveLeftOffGroup=()=>{var e;null===(e=this.previousElementSibling)||void 0===e||e.focus()},this.focusOutHandler=e=>{const t=this.slottedRadioButtons,i=e.target,o=null!==i?t.indexOf(i):0,n=this.focusedRadio?t.indexOf(this.focusedRadio):-1;return(0===n&&o===n||n===t.length-1&&n===o)&&(this.selectedRadio?(this.focusedRadio=this.selectedRadio,this.isInsideFoundationToolbar||(this.selectedRadio.setAttribute("tabindex","0"),t.forEach((e=>{e!==this.selectedRadio&&e.setAttribute("tabindex","-1")})))):(this.focusedRadio=t[0],this.focusedRadio.setAttribute("tabindex","0"),t.forEach((e=>{e!==this.focusedRadio&&e.setAttribute("tabindex","-1")})))),!0},this.clickHandler=e=>{const t=e.target;if(t){const e=this.slottedRadioButtons;t.checked||0===e.indexOf(t)?(t.setAttribute("tabindex","0"),this.selectedRadio=t):(t.setAttribute("tabindex","-1"),this.selectedRadio=null),this.focusedRadio=t}e.preventDefault()},this.shouldMoveOffGroupToTheRight=(e,t,i)=>e===t.length&&this.isInsideToolbar&&i===pu,this.shouldMoveOffGroupToTheLeft=(e,t)=>(this.focusedRadio?e.indexOf(this.focusedRadio)-1:0)<0&&this.isInsideToolbar&&t===uu,this.checkFocusedRadio=()=>{null===this.focusedRadio||this.focusedRadio.readOnly||this.focusedRadio.checked||(this.focusedRadio.checked=!0,this.focusedRadio.setAttribute("tabindex","0"),this.focusedRadio.focus(),this.selectedRadio=this.focusedRadio)},this.moveRight=e=>{const t=this.slottedRadioButtons;let i=0;if(i=this.focusedRadio?t.indexOf(this.focusedRadio)+1:1,this.shouldMoveOffGroupToTheRight(i,t,e.key))this.moveRightOffGroup();else for(i===t.length&&(i=0);i1;){if(!t[i].disabled){this.moveToRadioByIndex(t,i);break}if(this.focusedRadio&&i===t.indexOf(this.focusedRadio))break;if(i+1>=t.length){if(this.isInsideToolbar)break;i=0}else i+=1}},this.moveLeft=e=>{const t=this.slottedRadioButtons;let i=0;if(i=this.focusedRadio?t.indexOf(this.focusedRadio)-1:0,i=i<0?t.length-1:i,this.shouldMoveOffGroupToTheLeft(t,e.key))this.moveLeftOffGroup();else for(;i>=0&&t.length>1;){if(!t[i].disabled){this.moveToRadioByIndex(t,i);break}if(this.focusedRadio&&i===t.indexOf(this.focusedRadio))break;i-1<0?i=t.length-1:i-=1}},this.keydownHandler=e=>{const t=e.key;if(t in xu&&this.isInsideFoundationToolbar)return!0;switch(t){case fu:this.checkFocusedRadio();break;case pu:case hu:this.direction===Ul.ltr?this.moveRight(e):this.moveLeft(e);break;case uu:case gu:this.direction===Ul.ltr?this.moveLeft(e):this.moveRight(e);break;default:return!0}}}readOnlyChanged(){void 0!==this.slottedRadioButtons&&this.slottedRadioButtons.forEach((e=>{this.readOnly?e.readOnly=!0:e.readOnly=!1}))}disabledChanged(){void 0!==this.slottedRadioButtons&&this.slottedRadioButtons.forEach((e=>{this.disabled?e.disabled=!0:e.disabled=!1}))}nameChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.forEach((e=>{e.setAttribute("name",this.name)}))}valueChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.forEach((e=>{e.value===this.value&&(e.checked=!0,this.selectedRadio=e)})),this.$emit("change")}slottedRadioButtonsChanged(e,t){this.slottedRadioButtons&&this.slottedRadioButtons.length>0&&this.setupRadioButtons()}get parentToolbar(){return this.closest('[role="toolbar"]')}get isInsideToolbar(){var e;return null!==(e=this.parentToolbar)&&void 0!==e&&e}get isInsideFoundationToolbar(){var e;return!!(null===(e=this.parentToolbar)||void 0===e?void 0:e["$fastController"])}connectedCallback(){super.connectedCallback(),this.direction=iu(this),this.setupRadioButtons()}disconnectedCallback(){this.slottedRadioButtons.forEach((e=>{e.removeEventListener("change",this.radioChangeHandler)}))}setupRadioButtons(){const e=this.slottedRadioButtons.filter((e=>e.hasAttribute("checked"))),t=e?e.length:0;if(t>1){e[t-1].checked=!0}let i=!1;if(this.slottedRadioButtons.forEach((e=>{void 0!==this.name&&e.setAttribute("name",this.name),this.disabled&&(e.disabled=!0),this.readOnly&&(e.readOnly=!0),this.value&&this.value===e.value?(this.selectedRadio=e,this.focusedRadio=e,e.checked=!0,e.setAttribute("tabindex","0"),i=!0):(this.isInsideFoundationToolbar||e.setAttribute("tabindex","-1"),e.checked=!1),e.addEventListener("change",this.radioChangeHandler)})),void 0===this.value&&this.slottedRadioButtons.length>0){const e=this.slottedRadioButtons.filter((e=>e.hasAttribute("checked"))),t=null!==e?e.length:0;if(t>0&&!i){const i=e[t-1];i.checked=!0,this.focusedRadio=i,i.setAttribute("tabindex","0")}else this.slottedRadioButtons[0].setAttribute("tabindex","0"),this.focusedRadio=this.slottedRadioButtons[0]}}}$l([Es({attribute:"readonly",mode:"boolean"})],qp.prototype,"readOnly",void 0),$l([Es({attribute:"disabled",mode:"boolean"})],qp.prototype,"disabled",void 0),$l([Es],qp.prototype,"name",void 0),$l([Es],qp.prototype,"value",void 0),$l([Es],qp.prototype,"orientation",void 0),$l([Hr],qp.prototype,"childItems",void 0),$l([Hr],qp.prototype,"slottedRadioButtons",void 0);const Kp=qp.compose({baseName:"radio-group",template:(e,t)=>{return ws` `;var i},styles:(e,t)=>Br` ${Mu("flex")} :host { align-items: flex-start; margin: calc(${kc} * 1px) 0; flex-direction: column; } .positioning-region { display: flex; flex-wrap: wrap; } :host([orientation="vertical"]) .positioning-region { flex-direction: column; } :host([orientation="horizontal"]) .positioning-region { flex-direction: row; } `});let Wp=0;function Gp(e=""){return`${e}${Wp++}`}class Xp extends Hh{constructor(){super(...arguments),this._options=[],this.selectedIndex=-1,this.selectedOptions=[],this.shouldSkipFocus=!1,this.typeaheadBuffer="",this.typeaheadExpired=!0,this.typeaheadTimeout=-1}get firstSelectedOption(){var e;return null!==(e=this.selectedOptions[0])&&void 0!==e?e:null}get hasSelectableOptions(){return this.options.length>0&&!this.options.every((e=>e.disabled))}get length(){var e,t;return null!==(t=null===(e=this.options)||void 0===e?void 0:e.length)&&void 0!==t?t:0}get options(){return zr.track(this,"options"),this._options}set options(e){this._options=e,zr.notify(this,"options")}get typeAheadExpired(){return this.typeaheadExpired}set typeAheadExpired(e){this.typeaheadExpired=e}clickHandler(e){const t=e.target.closest(`option,[role=option]`);if(t&&!t.disabled)return this.selectedIndex=this.options.indexOf(t),!0}focusAndScrollOptionIntoView(e=this.firstSelectedOption){this.contains(document.activeElement)&&null!==e&&(e.focus(),requestAnimationFrame((()=>{e.scrollIntoView({block:"nearest"})})))}focusinHandler(e){this.shouldSkipFocus||e.target!==e.currentTarget||(this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}getTypeaheadMatches(){const e=this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`^${e}`,"gi");return this.options.filter((e=>e.text.trim().match(t)))}getSelectableIndex(e=this.selectedIndex,t){const i=e>t?-1:e!e&&!t.disabled&&i!e&&!t.disabled&&i>o?t:e),n)}return this.options.indexOf(n)}handleChange(e,t){if("selected"===t)Xp.slottedOptionFilter(e)&&(this.selectedIndex=this.options.indexOf(e)),this.setSelectedOptions()}handleTypeAhead(e){this.typeaheadTimeout&&window.clearTimeout(this.typeaheadTimeout),this.typeaheadTimeout=window.setTimeout((()=>this.typeaheadExpired=!0),Xp.TYPE_AHEAD_TIMEOUT_MS),e.length>1||(this.typeaheadBuffer=`${this.typeaheadExpired?"":this.typeaheadBuffer}${e}`)}keydownHandler(e){if(this.disabled)return!0;this.shouldSkipFocus=!1;const t=e.key;switch(t){case bu:e.shiftKey||(e.preventDefault(),this.selectFirstOption());break;case hu:e.shiftKey||(e.preventDefault(),this.selectNextOption());break;case gu:e.shiftKey||(e.preventDefault(),this.selectPreviousOption());break;case mu:e.preventDefault(),this.selectLastOption();break;case wu:return this.focusAndScrollOptionIntoView(),!0;case fu:case vu:return!0;case yu:if(this.typeaheadExpired)return!0;default:return 1===t.length&&this.handleTypeAhead(`${t}`),!0}}mousedownHandler(e){return this.shouldSkipFocus=!this.contains(document.activeElement),!0}multipleChanged(e,t){this.ariaMultiSelectable=t?"true":null}selectedIndexChanged(e,t){var i;if(this.hasSelectableOptions){if((null===(i=this.options[this.selectedIndex])||void 0===i?void 0:i.disabled)&&"number"==typeof e){const i=this.getSelectableIndex(e,t),o=i>-1?i:e;return this.selectedIndex=o,void(t===o&&this.selectedIndexChanged(t,o))}this.setSelectedOptions()}else this.selectedIndex=-1}selectedOptionsChanged(e,t){var i;const o=t.filter(Xp.slottedOptionFilter);null===(i=this.options)||void 0===i||i.forEach((e=>{const t=zr.getNotifier(e);t.unsubscribe(this,"selected"),e.selected=o.includes(e),t.subscribe(this,"selected")}))}selectFirstOption(){var e,t;this.disabled||(this.selectedIndex=null!==(t=null===(e=this.options)||void 0===e?void 0:e.findIndex((e=>!e.disabled)))&&void 0!==t?t:-1)}selectLastOption(){this.disabled||(this.selectedIndex=function(e,t){let i=e.length;for(;i--;)if(t(e[i],i,e))return i;return-1}(this.options,(e=>!e.disabled)))}selectNextOption(){!this.disabled&&this.selectedIndex0&&(this.selectedIndex=this.selectedIndex-1)}setDefaultSelectedOption(){var e,t;this.selectedIndex=null!==(t=null===(e=this.options)||void 0===e?void 0:e.findIndex((e=>e.defaultSelected)))&&void 0!==t?t:-1}setSelectedOptions(){var e,t,i;(null===(e=this.options)||void 0===e?void 0:e.length)&&(this.selectedOptions=[this.options[this.selectedIndex]],this.ariaActiveDescendant=null!==(i=null===(t=this.firstSelectedOption)||void 0===t?void 0:t.id)&&void 0!==i?i:"",this.focusAndScrollOptionIntoView())}slottedOptionsChanged(e,t){this.options=t.reduce(((e,t)=>(Fp(t)&&e.push(t),e)),[]);const i=`${this.options.length}`;this.options.forEach(((e,t)=>{e.id||(e.id=Gp("option-")),e.ariaPosInSet=`${t+1}`,e.ariaSetSize=i})),this.$fastController.isConnected&&(this.setSelectedOptions(),this.setDefaultSelectedOption())}typeaheadBufferChanged(e,t){if(this.$fastController.isConnected){const e=this.getTypeaheadMatches();if(e.length){const t=this.options.indexOf(e[0]);t>-1&&(this.selectedIndex=t)}this.typeaheadExpired=!1}}}Xp.slottedOptionFilter=e=>Fp(e)&&!e.hidden,Xp.TYPE_AHEAD_TIMEOUT_MS=1e3,$l([Es({mode:"boolean"})],Xp.prototype,"disabled",void 0),$l([Hr],Xp.prototype,"selectedIndex",void 0),$l([Hr],Xp.prototype,"selectedOptions",void 0),$l([Hr],Xp.prototype,"slottedOptions",void 0),$l([Hr],Xp.prototype,"typeaheadBuffer",void 0);class Yp{}function Qp(e,t,i=0){return[t,i]=[t,i].sort(((e,t)=>e-t)),t<=e&&ee.checked))}get firstSelectedOptionIndex(){return this.options.indexOf(this.firstSelectedOption)}activeIndexChanged(e,t){var i,o;this.ariaActiveDescendant=null!==(o=null===(i=this.options[t])||void 0===i?void 0:i.id)&&void 0!==o?o:"",this.focusAndScrollOptionIntoView()}checkActiveIndex(){if(!this.multiple)return;const e=this.activeOption;e&&(e.checked=!0)}checkFirstOption(e=!1){e?(-1===this.rangeStartIndex&&(this.rangeStartIndex=this.activeIndex+1),this.options.forEach(((e,t)=>{e.checked=Qp(t,this.rangeStartIndex)}))):this.uncheckAllOptions(),this.activeIndex=0,this.checkActiveIndex()}checkLastOption(e=!1){e?(-1===this.rangeStartIndex&&(this.rangeStartIndex=this.activeIndex),this.options.forEach(((e,t)=>{e.checked=Qp(t,this.rangeStartIndex,this.options.length)}))):this.uncheckAllOptions(),this.activeIndex=this.options.length-1,this.checkActiveIndex()}connectedCallback(){super.connectedCallback(),this.addEventListener("focusout",this.focusoutHandler)}disconnectedCallback(){this.removeEventListener("focusout",this.focusoutHandler),super.disconnectedCallback()}checkNextOption(e=!1){e?(-1===this.rangeStartIndex&&(this.rangeStartIndex=this.activeIndex),this.options.forEach(((e,t)=>{e.checked=Qp(t,this.rangeStartIndex,this.activeIndex+1)}))):this.uncheckAllOptions(),this.activeIndex+=this.activeIndex{e.checked=Qp(t,this.activeIndex,this.rangeStartIndex)}))):this.uncheckAllOptions(),this.activeIndex-=this.activeIndex>0?1:0,this.checkActiveIndex()}clickHandler(e){var t;if(!this.multiple)return super.clickHandler(e);const i=null===(t=e.target)||void 0===t?void 0:t.closest(`[role=option]`);return i&&!i.disabled?(this.uncheckAllOptions(),this.activeIndex=this.options.indexOf(i),this.checkActiveIndex(),this.toggleSelectedForAllCheckedOptions(),!0):void 0}focusAndScrollOptionIntoView(){super.focusAndScrollOptionIntoView(this.activeOption)}focusinHandler(e){if(!this.multiple)return super.focusinHandler(e);this.shouldSkipFocus||e.target!==e.currentTarget||(this.uncheckAllOptions(),-1===this.activeIndex&&(this.activeIndex=-1!==this.firstSelectedOptionIndex?this.firstSelectedOptionIndex:0),this.checkActiveIndex(),this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}focusoutHandler(e){this.multiple&&this.uncheckAllOptions()}keydownHandler(e){if(!this.multiple)return super.keydownHandler(e);if(this.disabled)return!0;const{key:t,shiftKey:i}=e;switch(this.shouldSkipFocus=!1,t){case bu:return void this.checkFirstOption(i);case hu:return void this.checkNextOption(i);case gu:return void this.checkPreviousOption(i);case mu:return void this.checkLastOption(i);case wu:return this.focusAndScrollOptionIntoView(),!0;case vu:return this.uncheckAllOptions(),this.checkActiveIndex(),!0;case yu:if(e.preventDefault(),this.typeAheadExpired)return void this.toggleSelectedForAllCheckedOptions();default:return 1===t.length&&this.handleTypeAhead(`${t}`),!0}}mousedownHandler(e){if(e.offsetX>=0&&e.offsetX<=this.scrollWidth)return super.mousedownHandler(e)}multipleChanged(e,t){var i;this.ariaMultiSelectable=t?"true":null,null===(i=this.options)||void 0===i||i.forEach((e=>{e.checked=!t&&void 0})),this.setSelectedOptions()}setSelectedOptions(){this.multiple?this.$fastController.isConnected&&this.options&&(this.selectedOptions=this.options.filter((e=>e.selected)),this.focusAndScrollOptionIntoView()):super.setSelectedOptions()}sizeChanged(e,t){var i;const o=Math.max(0,parseInt(null!==(i=null==t?void 0:t.toFixed())&&void 0!==i?i:"",10));o!==t&&Or.queueUpdate((()=>{this.size=o}))}toggleSelectedForAllCheckedOptions(){const e=this.checkedOptions.filter((e=>!e.disabled)),t=!e.every((e=>e.selected));e.forEach((e=>e.selected=t)),this.selectedIndex=this.options.indexOf(e[e.length-1]),this.setSelectedOptions()}typeaheadBufferChanged(e,t){if(this.multiple){if(this.$fastController.isConnected){const e=this.getTypeaheadMatches(),t=this.options.indexOf(e[0]);t>-1&&(this.activeIndex=t,this.uncheckAllOptions(),this.checkActiveIndex()),this.typeAheadExpired=!1}}else super.typeaheadBufferChanged(e,t)}uncheckAllOptions(e=!1){this.options.forEach((e=>e.checked=!this.multiple&&void 0)),e||(this.rangeStartIndex=-1)}}$l([Hr],Zp.prototype,"activeIndex",void 0),$l([Es({mode:"boolean"})],Zp.prototype,"multiple",void 0),$l([Es({converter:$s})],Zp.prototype,"size",void 0);class Jp extends Zp{}class eg extends(Nu(Jp)){constructor(){super(...arguments),this.proxy=document.createElement("select")}}const tg="above",ig="below";class og extends eg{constructor(){super(...arguments),this.open=!1,this.forcedPosition=!1,this.listboxId=Gp("listbox-"),this.maxHeight=0}openChanged(e,t){if(this.collapsible){if(this.open)return this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),this.indexWhenOpened=this.selectedIndex,void Or.queueUpdate((()=>this.focus()));this.ariaControls="",this.ariaExpanded="false"}}get collapsible(){return!(this.multiple||"number"==typeof this.size)}get value(){return zr.track(this,"value"),this._value}set value(e){var t,i,o,n,r,s,a;const l=`${this._value}`;if(null===(t=this._options)||void 0===t?void 0:t.length){const t=this._options.findIndex((t=>t.value===e)),l=null!==(o=null===(i=this._options[this.selectedIndex])||void 0===i?void 0:i.value)&&void 0!==o?o:null,c=null!==(r=null===(n=this._options[t])||void 0===n?void 0:n.value)&&void 0!==r?r:null;-1!==t&&l===c||(e="",this.selectedIndex=t),e=null!==(a=null===(s=this.firstSelectedOption)||void 0===s?void 0:s.value)&&void 0!==a?a:e}l!==e&&(this._value=e,super.valueChanged(l,e),zr.notify(this,"value"),this.updateDisplayValue())}updateValue(e){var t,i;this.$fastController.isConnected&&(this.value=null!==(i=null===(t=this.firstSelectedOption)||void 0===t?void 0:t.value)&&void 0!==i?i:""),e&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}selectedIndexChanged(e,t){super.selectedIndexChanged(e,t),this.updateValue()}positionChanged(e,t){this.positionAttribute=t,this.setPositioning()}setPositioning(){const e=this.getBoundingClientRect(),t=window.innerHeight-e.bottom;this.position=this.forcedPosition?this.positionAttribute:e.top>t?tg:ig,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.maxHeight=this.position===tg?~~e.top:~~t}get displayValue(){var e,t;return zr.track(this,"displayValue"),null!==(t=null===(e=this.firstSelectedOption)||void 0===e?void 0:e.text)&&void 0!==t?t:""}disabledChanged(e,t){super.disabledChanged&&super.disabledChanged(e,t),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),-1===this.selectedIndex&&(this.selectedIndex=0)}clickHandler(e){if(!this.disabled){if(this.open){const t=e.target.closest(`option,[role=option]`);if(t&&t.disabled)return}return super.clickHandler(e),this.open=this.collapsible&&!this.open,this.open||this.indexWhenOpened===this.selectedIndex||this.updateValue(!0),!0}}focusoutHandler(e){var t;if(super.focusoutHandler(e),!this.open)return!0;const i=e.relatedTarget;this.isSameNode(i)?this.focus():(null===(t=this.options)||void 0===t?void 0:t.includes(i))||(this.open=!1,this.indexWhenOpened!==this.selectedIndex&&this.updateValue(!0))}handleChange(e,t){super.handleChange(e,t),"value"===t&&this.updateValue()}slottedOptionsChanged(e,t){this.options.forEach((e=>{zr.getNotifier(e).unsubscribe(this,"value")})),super.slottedOptionsChanged(e,t),this.options.forEach((e=>{zr.getNotifier(e).subscribe(this,"value")})),this.setProxyOptions(),this.updateValue()}mousedownHandler(e){var t;return e.offsetX>=0&&e.offsetX<=(null===(t=this.listbox)||void 0===t?void 0:t.scrollWidth)?super.mousedownHandler(e):this.collapsible}multipleChanged(e,t){super.multipleChanged(e,t),this.proxy&&(this.proxy.multiple=t)}selectedOptionsChanged(e,t){var i;super.selectedOptionsChanged(e,t),null===(i=this.options)||void 0===i||i.forEach(((e,t)=>{var i;const o=null===(i=this.proxy)||void 0===i?void 0:i.options.item(t);o&&(o.selected=e.selected)}))}setDefaultSelectedOption(){var e;const t=null!==(e=this.options)&&void 0!==e?e:Array.from(this.children).filter(Xp.slottedOptionFilter),i=null==t?void 0:t.findIndex((e=>e.hasAttribute("selected")||e.selected||e.value===this.value));this.selectedIndex=-1===i?0:i}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach((e=>{const t=e.proxy||(e instanceof HTMLOptionElement?e.cloneNode():null);t&&this.proxy.options.add(t)})))}keydownHandler(e){super.keydownHandler(e);const t=e.key||e.key.charCodeAt(0);switch(t){case yu:e.preventDefault(),this.collapsible&&this.typeAheadExpired&&(this.open=!this.open);break;case bu:case mu:e.preventDefault();break;case fu:e.preventDefault(),this.open=!this.open;break;case vu:this.collapsible&&this.open&&(e.preventDefault(),this.open=!1);break;case wu:return this.collapsible&&this.open&&(e.preventDefault(),this.open=!1),!0}return this.open||this.indexWhenOpened===this.selectedIndex||(this.updateValue(!0),this.indexWhenOpened=this.selectedIndex),!(t===hu||t===gu)}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.addEventListener("contentchange",this.updateDisplayValue)}disconnectedCallback(){this.removeEventListener("contentchange",this.updateDisplayValue),super.disconnectedCallback()}sizeChanged(e,t){super.sizeChanged(e,t),this.proxy&&(this.proxy.size=t)}updateDisplayValue(){this.collapsible&&zr.notify(this,"displayValue")}}$l([Es({attribute:"open",mode:"boolean"})],og.prototype,"open",void 0),$l([Ur],og.prototype,"collapsible",null),$l([Hr],og.prototype,"control",void 0),$l([Es({attribute:"position"})],og.prototype,"positionAttribute",void 0),$l([Hr],og.prototype,"position",void 0),$l([Hr],og.prototype,"maxHeight",void 0);class ng{}$l([Hr],ng.prototype,"ariaControls",void 0),cu(ng,Yp),cu(og,su,ng);class rg extends og{constructor(){super(...arguments),this.listboxScrollWidth=""}connectedCallback(){super.connectedCallback(),this.listbox&&Pd.setValueFor(this.listbox,Ed)}get listboxMaxHeight(){return Math.floor(this.maxHeight/Th.getValueFor(this)).toString()}listboxScrollWidthChanged(){this.updateComputedStylesheet()}get selectSize(){var e;return`${null!==(e=this.size)&&void 0!==e?e:this.multiple?4:0}`}multipleChanged(e,t){super.multipleChanged(e,t),this.updateComputedStylesheet()}maxHeightChanged(e,t){this.collapsible&&this.updateComputedStylesheet()}setPositioning(){super.setPositioning(),this.updateComputedStylesheet()}sizeChanged(e,t){super.sizeChanged(e,t),this.updateComputedStylesheet(),this.collapsible?requestAnimationFrame((()=>{this.listbox.style.setProperty("display","flex"),this.listbox.style.setProperty("overflow","visible"),this.listbox.style.setProperty("visibility","hidden"),this.listbox.style.setProperty("width","auto"),this.listbox.hidden=!1,this.listboxScrollWidth=`${this.listbox.scrollWidth}`,this.listbox.hidden=!0,this.listbox.style.removeProperty("display"),this.listbox.style.removeProperty("overflow"),this.listbox.style.removeProperty("visibility"),this.listbox.style.removeProperty("width")})):this.listboxScrollWidth=""}updateComputedStylesheet(){this.computedStylesheet&&this.$fastController.removeStyles(this.computedStylesheet),this.computedStylesheet=Br` :host { --listbox-max-height: ${this.listboxMaxHeight}; --listbox-scroll-width: ${this.listboxScrollWidth}; --size: ${this.selectSize}; } `,this.$fastController.addStyles(this.computedStylesheet)}}$l([Hr],rg.prototype,"listboxScrollWidth",void 0);const sg=rg.compose({baseName:"select",baseClass:og,template:(e,t)=>ws` `,styles:(e,t)=>{const i=e.name===e.tagFor(og);return Br` ${Mu("inline-flex")} :host { --elevation: 14; background: ${rh}; border-radius: calc(${wc} * 1px); border: calc(${$c} * 1px) solid ${Bd}; box-sizing: border-box; color: ${kh}; font-family: ${vc}; height: calc(${Hu} * 1px); position: relative; user-select: none; min-width: 250px; outline: none; vertical-align: top; } ${i?Br` :host(:not([aria-haspopup])) { --elevation: 0; border: 0; height: auto; min-width: 0; } `:""} ${((e,t)=>{const i=e.tagFor(Bp),o=e.name===e.tagFor(Zp)?"":".listbox";return Br` ${o?"":Mu("inline-flex")} :host ${o} { background: ${Pd}; border: calc(${$c} * 1px) solid ${Ch}; border-radius: calc(${wc} * 1px); box-sizing: border-box; flex-direction: column; padding: calc(${kc} * 1px) 0; } ${o?``:Br` :host(:focus-within:not([disabled])) { border-color: ${vh}; box-shadow: 0 0 0 calc((${Nc} - ${$c}) * 1px) ${vh} inset; } :host([disabled]) ::slotted(*) { cursor: ${Ru}; opacity: ${Cc}; pointer-events: none; } `} ${o||`:host([size])`} { max-height: calc( (var(--size) * ${Hu} + (${kc} * ${$c} * 2)) * 1px ); overflow-y: auto; } :host([size="0"]) ${o} { max-height: none; } `.withBehaviors(Au(Br` :host(:not([multiple]):${zu}) ::slotted(${i}[aria-selected="true"]), :host([multiple]:${zu}) ::slotted(${i}[aria-checked="true"]) { border-color: ${Fu.ButtonText}; box-shadow: 0 0 0 calc(${Nc} * 1px) inset ${Fu.HighlightText}; } :host(:not([multiple]):${zu}) ::slotted(${i}[aria-selected="true"]) { background: ${Fu.Highlight}; color: ${Fu.HighlightText}; fill: currentcolor; } ::slotted(${i}[aria-selected="true"]:not([aria-checked="true"])) { background: ${Fu.Highlight}; border-color: ${Fu.HighlightText}; color: ${Fu.HighlightText}; } `))})(e)} :host .listbox { ${xp} border: none; display: flex; left: 0; position: absolute; width: 100%; z-index: 1; } .control + .listbox { --stroke-size: calc(${kc} * ${$c} * 2); max-height: calc( (var(--listbox-max-height) * ${Hu} + var(--stroke-size)) * 1px ); } ${i?Br` :host(:not([aria-haspopup])) .listbox { left: auto; position: static; z-index: auto; } `:""} .listbox[hidden] { display: none; } .control { align-items: center; box-sizing: border-box; cursor: pointer; display: flex; font-size: ${Ec}; font-family: inherit; line-height: ${Lc}; min-height: 100%; padding: 0 calc(${kc} * 2.25px); width: 100%; } :host(:not([disabled]):hover) { background: ${sh}; border-color: ${Md}; } :host(:${zu}) { border-color: ${vh}; } :host(:not([size]):not([multiple]):not([open]):${zu}), :host([multiple]:${zu}), :host([size]:${zu}) { box-shadow: 0 0 0 calc(${Nc} * 1px) ${vh}; } :host(:not([multiple]):not([size]):${zu}) ::slotted(${e.tagFor(Bp)}[aria-selected="true"]:not([disabled])) { box-shadow: 0 0 0 calc(${Nc} * 1px) inset ${mh}; border-color: ${vh}; background: ${jd}; color: ${Wd}; } :host([disabled]) { cursor: ${Ru}; opacity: ${Cc}; } :host([disabled]) .control { cursor: ${Ru}; user-select: none; } :host([disabled]:hover) { background: ${ch}; color: ${kh}; fill: currentcolor; } :host(:not([disabled])) .control:active { background: ${ah}; border-color: ${Vd}; border-radius: calc(${wc} * 1px); } :host([open][position="above"]) .listbox { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; bottom: calc(${Hu} * 1px); } :host([open][position="below"]) .listbox { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; top: calc(${Hu} * 1px); } .selected-value { flex: 1 1 auto; font-family: inherit; min-width: calc(var(--listbox-scroll-width, 0) - (${kc} * 4) * 1px); overflow: hidden; text-align: start; text-overflow: ellipsis; white-space: nowrap; } .indicator { flex: 0 0 auto; margin-inline-start: 1em; } slot[name="listbox"] { display: none; width: 100%; } :host([open]) slot[name="listbox"] { display: flex; position: absolute; ${xp} } .end { margin-inline-start: auto; } .start, .end, .indicator, .select-indicator, ::slotted(svg) { /* TODO: adaptive typography https://github.com/microsoft/fast/issues/2432 */ fill: currentcolor; height: 1em; min-height: calc(${kc} * 4px); min-width: calc(${kc} * 4px); width: 1em; } ::slotted([role="option"]), ::slotted(option) { flex: 0 0 auto; } `.withBehaviors(Au(Br` :host(:not([disabled]):hover), :host(:not([disabled]):active) { border-color: ${Fu.Highlight}; } :host(:not([disabled]):${zu}) { background-color: ${Fu.ButtonFace}; box-shadow: 0 0 0 calc(${Nc} * 1px) ${Fu.Highlight}; color: ${Fu.ButtonText}; fill: currentcolor; forced-color-adjust: none; } :host(:not([disabled]):${zu}) .listbox { background: ${Fu.ButtonFace}; } :host([disabled]) { border-color: ${Fu.GrayText}; background-color: ${Fu.ButtonFace}; color: ${Fu.GrayText}; fill: currentcolor; opacity: 1; forced-color-adjust: none; } :host([disabled]:hover) { background: ${Fu.ButtonFace}; } :host([disabled]) .control { color: ${Fu.GrayText}; border-color: ${Fu.GrayText}; } :host([disabled]) .control .select-indicator { fill: ${Fu.GrayText}; } :host(:${zu}) ::slotted([aria-selected="true"][role="option"]), :host(:${zu}) ::slotted(option[aria-selected="true"]), :host(:${zu}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { background: ${Fu.Highlight}; border-color: ${Fu.ButtonText}; box-shadow: 0 0 0 calc(${Nc} * 1px) inset ${Fu.HighlightText}; color: ${Fu.HighlightText}; fill: currentcolor; } .start, .end, .indicator, .select-indicator, ::slotted(svg) { color: ${Fu.ButtonText}; fill: currentcolor; } `))},indicator:`\n \n \n \n `});class ag extends Hh{}class lg extends(Nu(ag)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const cg="text";class dg extends lg{constructor(){super(...arguments),this.type=cg}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&Or.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}}$l([Es({attribute:"readonly",mode:"boolean"})],dg.prototype,"readOnly",void 0),$l([Es({mode:"boolean"})],dg.prototype,"autofocus",void 0),$l([Es],dg.prototype,"placeholder",void 0),$l([Es],dg.prototype,"type",void 0),$l([Es],dg.prototype,"list",void 0),$l([Es({converter:$s})],dg.prototype,"maxlength",void 0),$l([Es({converter:$s})],dg.prototype,"minlength",void 0),$l([Es],dg.prototype,"pattern",void 0),$l([Es({converter:$s})],dg.prototype,"size",void 0),$l([Es({mode:"boolean"})],dg.prototype,"spellcheck",void 0),$l([Hr],dg.prototype,"defaultSlottedNodes",void 0);class hg{}function ug(e,t,i){return e.nodeType!==Node.TEXT_NODE||"string"==typeof e.nodeValue&&!!e.nodeValue.trim().length}cu(hg,ru),cu(dg,su,hg);class pg extends dg{constructor(){super(...arguments),this.appearance="outline"}}$l([Es],pg.prototype,"appearance",void 0);const gg=pg.compose({baseName:"text-field",baseClass:dg,template:(e,t)=>ws` `,styles:(e,t)=>Br` ${Mu("inline-block")} :host { font-family: ${vc}; outline: none; user-select: none; } .root { box-sizing: border-box; position: relative; display: flex; flex-direction: row; color: ${kh}; background: ${rh}; border-radius: calc(${wc} * 1px); border: calc(${$c} * 1px) solid ${Bd}; height: calc(${Hu} * 1px); align-items: baseline; } .control { -webkit-appearance: none; font: inherit; background: transparent; border: 0; color: inherit; height: calc(100% - 4px); width: 100%; margin-top: auto; margin-bottom: auto; border: none; padding: 0 calc(${kc} * 2px + 1px); font-size: ${Ec}; line-height: ${Lc}; } .control:hover, .control:${zu}, .control:disabled, .control:active { outline: none; } .label { display: block; color: ${kh}; cursor: pointer; font-size: ${Ec}; line-height: ${Lc}; margin-bottom: 4px; } .label__hidden { display: none; visibility: hidden; } .start, .control, .end { align-self: center; } .start, .end { display: flex; margin: auto; fill: currentcolor; } ::slotted(svg) { /* TODO: adaptive typography https://github.com/microsoft/fast/issues/2432 */ width: 16px; height: 16px; } .start { margin-inline-start: 11px; } .end { margin-inline-end: 11px; } :host(:hover:not([disabled])) .root { background: ${sh}; border-color: ${Md}; } :host(:active:not([disabled])) .root { background: ${sh}; border-color: ${Vd}; } :host(:focus-within:not([disabled])) .root { border-color: ${vh}; box-shadow: 0 0 0 calc(${Nc} * 1px) ${vh} inset; } :host([appearance="filled"]) .root { background: ${th}; } :host([appearance="filled"]:hover:not([disabled])) .root { background: ${ih}; } :host([disabled]) .label, :host([readonly]) .label, :host([readonly]) .control, :host([disabled]) .control { cursor: ${Ru}; } :host([disabled]) { opacity: ${Cc}; } :host([disabled]) .control { border-color: ${Ch}; } `.withBehaviors(Au(Br` .root, :host([appearance="filled"]) .root { forced-color-adjust: none; background: ${Fu.Field}; border-color: ${Fu.FieldText}; } :host(:hover:not([disabled])) .root, :host([appearance="filled"]:hover:not([disabled])) .root, :host([appearance="filled"]:hover) .root { background: ${Fu.Field}; border-color: ${Fu.Highlight}; } .start, .end { fill: currentcolor; } :host([disabled]) { opacity: 1; } :host([disabled]) .root, :host([appearance="filled"]:hover[disabled]) .root { border-color: ${Fu.GrayText}; background: ${Fu.Field}; } :host(:focus-within:enabled) .root { border-color: ${Fu.Highlight}; box-shadow: 0 0 0 1px ${Fu.Highlight} inset; } input::placeholder { color: ${Fu.GrayText}; } `)),shadowOptions:{delegatesFocus:!0}}),fg=Hl.create("wlp-box-shadow"),vg=Hl.create("wlp-status-bar-height"),bg=Hl.create("wlp-status-bar-padding"),mg=Hl.create("wlp-status-bordered-item-padding"),yg=Hl.create("wlp-text-highlight-color"),wg=Hl.create("wlp-zIndex"),xg=Hl.create("wlp-selection-color"),kg=Hl.create("wlp-tag-text-color"),Sg=Hl.create("wlp-code-font");function Cg(e){Qh.getOrCreate().withDesignTokenRoot(e).register(nu(),Zu(),ip(),ap(),kp(),Np(),Dp(),Ap(),Vp(),Up(),Kp(),sg(),gg()),fg.withDefault("0px -1px 4px rgba(0, 0, 0, 0.5)"),vg.withDefault("30px"),bg.withDefault("6px"),mg.withDefault("4px"),wg.withDefault(ur.max.toString()),Ec.withDefault("12px"),Lc.withDefault("16px"),vc.withDefault("'Segoe UI', sans-serif"),Sg.withDefault("'Cascadia Code', 'Consolas', monospace"),$g()}function $g(){const e=Ih(),t=wl.from(tc(e.neutralBaseColor)),i=ac.from(t);kd.withDefault(i);const o=wl.from(tc(e.accentColor)),n=ac.from(o);if(Cd.withDefault(n),yc.withDefault(e.baseLayerLuminance),Pd.withDefault(e.backgroundToken),e.useThemeColors)xg.withDefault(Bd),yg.withDefault("#007ACC30"),kg.withDefault(Ud);else{const t=wl.from(tc(e.selectionColor));xg.withDefault(t),yg.withDefault(e.textHighlightColor+"30");const i=wl.from(tc(e.tagTextColor));kg.withDefault(i)}}class Ng{constructor(e){this._browserLink=e}initialize(){this._browserLink.log("Initializing tools services..."),this._browserLink.browserLinkConnectionStatusService.isConnected=!0,this._browserLink.log("Initializing tools design surface service"),this._browserLink.designSurfaceService.initialize();const e=Nn("status.generatingLogicalTree");this._browserLink.statusService.currentStatus={messageType:0,displayText:e,fullText:e},this._browserLink.log("Initializing tools selection service"),this._browserLink.selectionService.initialize(),this._browserLink.log("Initializing tools tag navigation service"),this._browserLink.tagNavigationService.initialize(),this._browserLink.log("Initializing tools hotkey manager service"),this._browserLink.hotkeyManagerService.initialize(),this._browserLink.sourceMapping.ensureUpToDateAsync((async()=>{this._browserLink.log("Logical tree initialization detected in tools extension"),this._browserLink.logicalTreeInitializedStatusService.isInitialized=!0,this._browserLink.log("Setting current status");const e=await this._browserLink.currentUpdateStatusService.getCurrentMessageType(),t=await this._browserLink.currentUpdateStatusService.getCurrentUpdateFullStatus(),i=await this._browserLink.currentUpdateStatusService.getCurrentUpdateShortStatus(),o=function(e,t){switch(e){case"Warning":return 1;case"Error":return 2;case"Info":return 0;default:return t.log("Error: setStatus() message type isn't expected. The message type value is: "+e),0}}(e,this._browserLink);this._browserLink.statusService.currentStatus={messageType:o,fullText:t,displayText:i},this._browserLink.log(`Current status set: ${t}/${i}`),this._browserLink.keyboardNavigationService.updatePositionMap(),this._browserLink.log("Tools service initialization finished"),this._browserLink.designSurfaceService.isReady=!0}))}uninitialize(){this._browserLink.designSurfaceService.uninitialize(),this._browserLink.selectionService.uninitialize(),this._rootElement&&this._rootElement.remove()}renderLivePreviewBrowserUI(){this._rootElement=new qa,Cg(this._rootElement),function(e,t){Ws.getOrCreateDOMContainer(e,{responsibleForOwnerRequests:!0}).register(pa.instance(xa,t),pa.instance(ka,t.selectionHostingService),pa.instance(Sa,t.toolsLifetimeService),pa.instance(Ca,t.selectionService),pa.instance($a,t.browserLinkConnectionStatusService),pa.instance(Na,t.logicalTreeInitializedStatusService),pa.instance(Ea,t.simpleTextEditingService),pa.instance(La,t.keyboardNavigationService),pa.instance(Ta,t.statusService),pa.instance(Oa,t.tagNavigationService),pa.instance(_a,t.hotkeyManagerService),pa.instance(Ia,t.updateBrowserButtonService),pa.instance(Da,t.designSurfaceService),pa.instance(Pa,t.disableUserPageInteractionsService),pa.instance(Ra,t.expandEmptyElementsService),pa.singleton(Aa,ja),pa.singleton(Fa,c),pa.instance(Ba,t.quickEditingService))}(this._rootElement,this._browserLink),document.body.appendChild(this._rootElement)}updateToolsTheme(e){!function(e){Bh(e)}(e),$g()}}class Eg{createElement(e,t){return document.createElement(e,t)}}var Lg;!function(e){e[e["NORMAL_NAVIGATION"]=1]="NORMAL_NAVIGATION",e[e["MENU_NAVIGATION"]=2]="MENU_NAVIGATION",e[e["CLOSE_DIALOG_NAVIGATION"]=3]="CLOSE_DIALOG_NAVIGATION"}(Lg||(Lg={}));class Tg{constructor(e){this._arrowKeyMode=Lg.NORMAL_NAVIGATION,this._arrowKeyHandlers=new Map,this._arrowKeyModeAssociatedNode=new Map,this._browserLink=e}initialize(){this._arrowKeyHandlers.set(Lg.NORMAL_NAVIGATION,this._browserLink.keyboardNavigationService.onArrowKeyDown.bind(this._browserLink.keyboardNavigationService))}get arrowKeyMode(){return this._arrowKeyMode}set arrowKeyMode(e){if(this._arrowKeyMode=e,this._arrowKeyMode&&this._arrowKeyModeAssociatedNode.has(this._arrowKeyMode)){const e=this._arrowKeyModeAssociatedNode.get(this._arrowKeyMode);e&&e.focus()}}setArrowKeyModeAssociatedNode(e,t){this._arrowKeyModeAssociatedNode.set(e,t)}onArrowKeyPressed(e){this._arrowKeyMode&&this._arrowKeyHandlers.has(this._arrowKeyMode)&&this._arrowKeyHandlers.get(this._arrowKeyMode)(e)}}class Og{constructor(e){var t;this._textNodeBeingEditedChanged=new n.pB,this._browserLink=e,this._documentWrapper=new Eg,this._textNodeBeingEdited=null,this._editableTempWrapper=null,this._focusOutEventListener=null,null!==(t=this._browserLink)&&void 0!==t&&t.selectionService&&this._browserLink.selectionService.selectionChanged.subscribe(this.onSelectionChanged.bind(this))}get textNodeBeingEditedChanged(){return this._textNodeBeingEditedChanged.asEvent()}get textNodeBeingEdited(){return this._textNodeBeingEdited}set textNodeBeingEdited(e){const t={prevEditedNode:this._textNodeBeingEdited,newEditedNode:null,isTextEditModeEnabled:!1};if(null===e){if(null===this._textNodeBeingEdited)return;this.escapeEditingMode(),t.newEditedNode=null,t.isTextEditModeEnabled=!1}else{if(!1===this.shouldEnableEditingMode(e))return;this.enableEditingMode(e),t.newEditedNode=this._textNodeBeingEdited,t.isTextEditModeEnabled=!0}this._textNodeBeingEditedChanged.dispatch(this,t)}onSelectionChanged(e,t){if(null===this._textNodeBeingEdited)return;if(this._browserLink.logicalTree.getFirstLogicalNodeFromDomNode(this._textNodeBeingEdited)===t.newSelectedNode)throw Error("Nodes under simple text editing mode should not be newly selected node.");this.textNodeBeingEdited=null}onEscapeEditingModeWithoutSave(e){var t;if(e.preventDefault(),null===this.textNodeBeingEdited)return;const i=this._editableTempWrapper,o=i.parentElement;this._focusOutEventListener&&(i.removeEventListener("focusout",this._focusOutEventListener),this._focusOutEventListener=null),o.insertBefore(this._textNodeBeingEdited,i),this._textNodeBeingEdited.textContent=this._textNodeContentPreEditing,i.remove();const n=null===(t=this._browserLink.designSurfaceService)||void 0===t?void 0:t.selectionOverlayElement;n&&(n.style.zIndex=ur.max.toString()),this._textNodeBeingEdited=null,this._textNodeContentPreEditing=null,this._editableTempWrapper=null,this._browserLink.hotkeyManagerService.arrowKeyMode=Lg.NORMAL_NAVIGATION,this._browserLink.disableUserPageInteractionsService.disableUserInteractionsOnUserPageRoots()}onEscapeEditingModeWithHotkey(e){e.preventDefault(),this.escapeEditingMode()}escapeEditingMode(){var e;const t=this._editableTempWrapper,i=t.parentElement,o=this._browserLink.logicalTree.getFirstLogicalNodeFromDomNode(this._textNodeBeingEdited);let n="";this._textNodeBeingEdited.parentNode===t&&(n=t.textContent),this._browserLink.logicalTreeEditingService.replaceTextInTextNode(o,n),this._textNodeBeingEdited.textContent=t.textContent,this._focusOutEventListener&&(t.removeEventListener("focusout",this._focusOutEventListener),this._focusOutEventListener=null),i.insertBefore(this._textNodeBeingEdited,t),t.remove();const r=null===(e=this._browserLink.designSurfaceService)||void 0===e?void 0:e.selectionOverlayElement;r&&(r.style.zIndex=ur.max.toString()),this._textNodeBeingEdited=null,this._textNodeContentPreEditing=null,this._editableTempWrapper=null,this._browserLink.hotkeyManagerService.arrowKeyMode=Lg.NORMAL_NAVIGATION,this._browserLink.disableUserPageInteractionsService.disableUserInteractionsOnUserPageRoots()}enableEditingMode(e){var t;this._browserLink.disableUserPageInteractionsService.enableUserInteractionsOnUserPageRoots();const i=this._documentWrapper.createElement("span");i.setAttribute("contentEditable","true"),i.id=pr.editableTextParent,e.parentElement.insertBefore(i,e),i.appendChild(e);const o=vr(i);o&&(o.bind(dr.escape,this.onEscapeEditingModeWithoutSave.bind(this)),o.bind(dr.enter,this.onEscapeEditingModeWithHotkey.bind(this))),this._textNodeBeingEdited=e,this._textNodeContentPreEditing=e.textContent,this._editableTempWrapper=i;const n=null===(t=this._browserLink.designSurfaceService)||void 0===t?void 0:t.selectionOverlayElement;n&&(n.style.zIndex=ur.maxMinus1.toString()),i.style.zIndex=ur.max.toString(),i.style.position="relative",i.style.outline="1px solid rgba(173, 216, 230, 0.8)",i.style.display="inline",i.style.cursor="text",i.setAttribute("role","textbox"),i.setAttribute("tabIndex","-1"),i.setAttribute("aria-label",Nn("simpleTextEditing.editableText_ariaLabel")),this._focusOutEventListener=this.onTextEditingElementFocusOut.bind(this),i.addEventListener("focusout",this._focusOutEventListener),i.focus(),this.selectElementContents(i)}onTextEditingElementFocusOut(e){this.textNodeBeingEdited=null}selectElementContents(e){const t=window.getSelection(),i=document.createRange();i.selectNodeContents(e),t.removeAllRanges(),t.addRange(i)}shouldEnableEditingMode(e){if(e===this._textNodeBeingEdited)return!1;if(e.nodeType===Node.TEXT_NODE&&e.textContent){const t=this._browserLink.logicalTree.getLogicalNodesFromDomNode(e);return 1===t.length&&!r(t[0]).isUnsupported}return!1}}const _g=Br` :host { font-family: var(--body-font); font-size: var(--type-ramp-base-font-size); line-height: var(--type-ramp-base-line-height); color: ${kh}; position: fixed; z-index: var(--wlp-zIndex); } fast-anchored-region { margin-left: 10px; } .container { border: 1px solid black; background-color: ${Ed}; box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5); } .header { background-color: ${th}; color: ${kh}; padding: 5px 10px; text-align: center; font-weight: bold; } .body { padding: calc(var(--design-unit) * 2px); } ul { list-style-type: none; padding: 0; margin-block-start: 0; margin-block-end: 0; } li + li { margin-top: 5px; } a { color: ${kh}; text-decoration: underline; } .body fast-button { color: ${kh}; text-decoration: underline; height: initial; } fast-checkbox { --design-unit: 3; } fast-select, fast-text-field { --design-unit: 2; min-width: 150px; width: 150px; } .textItem { font-weight: bold; } .propertyContainer { display: grid; grid-template-columns: auto 1fr; gap: 10px; } .propertyLabel { white-space: nowrap; } .propertyEditor { text-align: right; } `;function Ig(e,t,i){return{index:e,removed:t,addedCount:i}}const Dg=0,Rg=1,Pg=2,Ag=3;function Fg(e,t,i,o,n,r){let s=0,a=0;const l=Math.min(i-t,r-n);if(0===t&&0===n&&(s=function(e,t,i){for(let o=0;o0||i>0;){if(0===t){n.push(Pg),i--;continue}if(0===i){n.push(Ag),t--;continue}const r=e[t-1][i-1],s=e[t-1][i],a=e[t][i-1];let l;l=s=0){e.splice(t,1),t--,s-=i.addedCount-i.removed.length,n.addedCount+=i.addedCount-o;const a=n.removed.length+i.removed.length-o;if(n.addedCount||a){let e=i.removed;if(n.indexi.index+i.addedCount){const t=n.removed.slice(i.index+i.addedCount-n.index);Bg.apply(e,t)}n.removed=e,i.indexo?i=o-e.addedCount:i<0&&(i=o+e.removed.length+i-e.addedCount),i<0&&(i=0),e.index=i,e}class Hg extends Vr{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(e,"$fastController",{value:this,enumerable:!1})}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.needsQueue&&(this.needsQueue=!1,Or.queueUpdate(this))}reset(e){this.oldCollection=e,this.needsQueue&&(this.needsQueue=!1,Or.queueUpdate(this))}flush(){const e=this.splices,t=this.oldCollection;if(void 0===e&&void 0===t)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;const i=void 0===t?Vg(this.source,e):Fg(this.source,0,this.source.length,t,0,t.length);this.notify(i)}}const Ug=Object.freeze({positioning:!1,recycle:!0});function qg(e,t,i,o){e.bind(t[i],o)}function Kg(e,t,i,o){const n=Object.create(o);n.index=i,n.length=t.length,e.bind(t[i],n)}class Wg{constructor(e,t,i,o,n,r){this.location=e,this.itemsBinding=t,this.templateBinding=o,this.options=r,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=qg,this.itemsBindingObserver=zr.binding(t,this,i),this.templateBindingObserver=zr.binding(o,this,n),r.positioning&&(this.bindView=Kg)}bind(e,t){this.source=e,this.originalContext=t,this.childContext=Object.create(t),this.childContext.parent=e,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(e,this.originalContext),this.template=this.templateBindingObserver.observe(e,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(e,t){e===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):e===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(t)}observeItems(e=!1){if(!this.items)return void(this.items=Sr);const t=this.itemsObserver,i=this.itemsObserver=zr.getNotifier(this.items),o=t!==i;o&&null!==t&&t.unsubscribe(this),(o||e)&&i.subscribe(this)}updateViews(e){const t=this.childContext,i=this.views,o=[],n=this.bindView;let r=0;for(let t=0,n=e.length;t0?o.shift():a.create();i.splice(c,0,l),n(l,s,c,t),l.insertBefore(r)}}for(let e=0,t=o.length;enew Hg(e)));const e=Array.prototype;if(e.$fastPatch)return;Reflect.defineProperty(e,"$fastPatch",{value:1,enumerable:!1});const t=e.pop,i=e.push,o=e.reverse,n=e.shift,r=e.sort,s=e.splice,a=e.unshift;e.pop=function(){const e=this.length>0,i=t.apply(this,arguments),o=this.$fastController;return void 0!==o&&e&&o.addSplice(Ig(this.length,[i],0)),i},e.push=function(){const e=i.apply(this,arguments),t=this.$fastController;return void 0!==t&&t.addSplice(zg(Ig(this.length-arguments.length,[],arguments.length),this)),e},e.reverse=function(){let e;const t=this.$fastController;void 0!==t&&(t.flush(),e=this.slice());const i=o.apply(this,arguments);return void 0!==t&&t.reset(e),i},e.shift=function(){const e=this.length>0,t=n.apply(this,arguments),i=this.$fastController;return void 0!==i&&e&&i.addSplice(Ig(0,[t],0)),t},e.sort=function(){let e;const t=this.$fastController;void 0!==t&&(t.flush(),e=this.slice());const i=r.apply(this,arguments);return void 0!==t&&t.reset(e),i},e.splice=function(){const e=s.apply(this,arguments),t=this.$fastController;return void 0!==t&&t.addSplice(zg(Ig(+arguments[0],e,arguments.length>2?arguments.length-2:0),this)),e},e.unshift=function(){const e=a.apply(this,arguments),t=this.$fastController;return void 0!==t&&t.addSplice(zg(Ig(0,[],arguments.length),this)),e}}(),this.isItemsBindingVolatile=zr.isVolatileBinding(e),this.isTemplateBindingVolatile=zr.isVolatileBinding(t)}createBehavior(e){return new Wg(e,this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function Xg(e,t,i=Ug){return new Gg(e,"function"==typeof t?t:()=>t,i)}const Yg=ws`${e=>e.DisplayName}`,Qg=ws` t.parent.handleMethodClicked(e,t.event)}>${e=>e.DisplayName} `,Zg=ws` {var t;return"true"===(null===(t=e.Value)||void 0===t?void 0:t.toLowerCase())}} ?disabled=${e=>e.IsReadOnly} title=${e=>e.IsReadOnly?Nn("actionPanel.readOnlyProperty"):""} @change=${(e,t)=>t.parent.handleUpdateProperty(e,`${t.event.target.checked}`)}> ${e=>e.DisplayName} `,Jg=ws`
${e=>e.DisplayName}
e.Value} aria-label=${e=>e.DisplayName} ?disabled=${e=>e.IsReadOnly} title=${e=>e.IsReadOnly?Nn("actionPanel.readOnlyProperty"):""} @change=${(e,t)=>t.parent.handleUpdateProperty(e,t.event.target.value)}> ${Xg((e=>e.StandardValues),ws` e} ?selected=${(e,t)=>e===t.parent.Value}>${e=>e} `)}
`,ef=ws`
${e=>e.DisplayName}
e.Value} aria-label=${e=>e.DisplayName} data-original-value=${e=>e.Value} ?disabled=${e=>e.IsReadOnly} title=${e=>e.IsReadOnly?Nn("actionPanel.readOnlyProperty"):""} @keydown=${(e,t)=>t.parent.handleEditorKeyDown(e,t.event)}>
`,tf=ws` ${e=>e.DisplayName} `,of=ws` ${xs((e=>"bool"===e.PropertyType),Zg)} ${xs((e=>"dropdown"===e.PropertyType),Jg)} ${xs((e=>"editor"===e.PropertyType),ef)} ${xs((e=>"textbox"===e.PropertyType),ef)} ${xs((e=>"unknown"===e.PropertyType),tf)} `,nf=ws` e.anchorElement} @loaded=${e=>e.handleAnchoredRegionLoaded()} vertical-inset vertical-positioning-mode="dynamic" vertical-default-position="bottom" horizontal-positioning-mode="locktodefault" horizontal-default-position="right" @click=${(e,t)=>t.event.stopPropagation()}>
${e=>e.header}
    ${Xg((e=>e.actionItems),ws`
  • ${xs((e=>"Text"===e.Type),Yg)} ${xs((e=>"Method"===e.Type),Qg)} ${xs((e=>"Property"===e.Type),of)}
  • `)}
`;var rf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let sf=class extends Fs{constructor(){super(...arguments),this.header="Action Panel"}handleMethodClicked(e,t){t.stopPropagation(),this.$emit("methodExecuted",{memberName:e.MemberName,relatedComponentMemberName:e.RelatedComponentMemberName})}handleUpdateProperty(e,t){this.$emit("updateProperty",{memberName:e.MemberName,newValue:t,relatedComponentMemberName:e.RelatedComponentMemberName})}handleEditorKeyDown(e,t){const i=t.target;return"Enter"===t.key?(this.handleUpdateProperty(e,i.value),!1):"Escape"!==t.key||(i.value=i.dataset.originalValue,!1)}forceAnchorUpdate(){var e;null===(e=this.anchoredRegion)||void 0===e||e.update()}connectedCallback(){super.connectedCallback(),this.designSurfaceService&&this.setViewportElement(this.designSurfaceService)}setViewportElement(e){this.anchoredRegion.viewportElement=e.selectionOverlayElement}handleAnchoredRegionLoaded(){var e;null===(e=this.anchoredRegion.querySelector("fast-checkbox,fast-text-field,fast-select,fast-button"))||void 0===e||e.focus()}};rf([Es],sf.prototype,"header",void 0),rf([Hr],sf.prototype,"actionItems",void 0),rf([Hr],sf.prototype,"anchorElement",void 0),rf([Da],sf.prototype,"designSurfaceService",void 0),rf([Hr],sf.prototype,"anchoredRegion",void 0),sf=rf([Bs({name:"action-panel",template:nf,styles:_g})],sf);const af=ws`

${Nn("closeDialog.header")}

${Nn("closeDialog.details")}

${Nn("closeDialog.choice_pageSession")} ${Nn("closeDialog.choice_visualStudioSession")} ${Nn("closeDialog.choice_permanent")}
e.handleOKClick()} tabindex="0">${Nn("buttons.confirm")} e.handleCancelClick()} tabindex="0">${Nn("buttons.cancel")}
`,lf=Br` :host[hidden] { display: none; } fast-dialog { --dialog-height: auto; --dialog-width: auto; } h2 { margin-top: 0; } .dialogContent { padding: 30px; } .dialogFooter { text-align: right; } fast-button { margin: auto 5px; min-width: 65px; } `;var cf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let df=class extends Fs{connectedCallback(){super.connectedCallback(),this._dialogMousetrap=vr(this.dialog),this._dialogMousetrap&&(this._dialogMousetrap.bind(dr.enter,this.onEnterKeyPressed.bind(this)),this._dialogMousetrap.bind(dr.escape,this.onEscapeKeyPressed.bind(this))),this.previousArrowKeyMode=this.hotkeyManagerService.arrowKeyMode,this.hotkeyManagerService.arrowKeyMode=Lg.CLOSE_DIALOG_NAVIGATION}disconnectedCallback(){super.disconnectedCallback(),this._dialogMousetrap&&(this._dialogMousetrap.unbind(dr.enter),this._dialogMousetrap.unbind(dr.escape)),null!==this.previousArrowKeyMode&&(this.hotkeyManagerService.arrowKeyMode=this.previousArrowKeyMode,this.previousArrowKeyMode=null)}onConfirmSelected(){let e;this.toolsLifetimeService.uninitialize(),e="Permanent"===this.radioGroup.value?2:"VisualStudioSession"===this.radioGroup.value?1:0,this.browserLink.hostLifetimeService.uninitialize(e),this.$emit("dismissed"),this.designSurfaceService.isEnabled=!1}onCancelSelected(){this.browserLink.telemetryService.sendCloseDialogCanceled(),this.$emit("dismissed")}onEnterKeyPressed(){this.onConfirmSelected()}onEscapeKeyPressed(){this.onCancelSelected()}handleCancelClick(){this.onCancelSelected()}handleOKClick(){this.onConfirmSelected()}};cf([xa],df.prototype,"browserLink",void 0),cf([Da],df.prototype,"designSurfaceService",void 0),cf([_a],df.prototype,"hotkeyManagerService",void 0),cf([Sa],df.prototype,"toolsLifetimeService",void 0),cf([Hr],df.prototype,"previousArrowKeyMode",void 0),df=cf([Bs({name:"close-dialog",template:af,styles:lf})],df);const hf=ws`
e.customStyle}>
e.insertionCursor} horizontal-positioning-mode="dynamic" vertical-positioning-mode="dynamic" horizontal-default-position="right" vertical-default-position="top" horizontal-inset>
${e=>e.topInsertionMarkerText}
${e=>e.codeText}
`,uf=Br` :host(:not([isVisible])) .insertionCursor, :host(:not([isVisible])) fast-anchored-region { display: none; } :host([isVisible]) .insertionCursor { position: fixed; border-style: dashed; border-width: 1; border-color: blue; width: 1; } .insertionCursor { pointer-events: none; } .insertionTooltip { background-color: ${xg}; font-weight: bold; padding: 2px 8px; border-radius: 3px; box-sizing: border-box; box-shadow: ${fg}; color: ${kg}; font-family: ${Sg}; font-size: ${Ec}; } .insertionMarker, .insertionCode { white-space: pre; } `;var pf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let gf=class extends Fs{mouseXChanged(e,t){this.setup()}mouseYChanged(e,t){this.setup()}isVisibleChanged(e,t){this.setup()}clearAll(){this.topInsertionMarkerText="",this.codeText="",this.customStyle=""}getCustomStyle(e,t,i){return`height: ${e}px;`+`top: ${t}px;`+`left: ${i}px;`}setup(){var e,t;if(!this.isConnected||!this.isVisible)return void this.clearAll();const i=this.nodesFromAreaUtil.getDroppableLogicalContainerNodeAtPoint(this.mouseX,this.mouseY,this.browserLink.logicalTree,this.nodeBoundingClientRectUtil);if(!i)return void this.clearAll();const o=this.nodesFromAreaUtil.getClosestNonWhitespaceLogicalChildNodeAtPoint(this.mouseX,this.mouseY,i,this.nodeBoundingClientRectUtil);let n=(null!==(e=null===(t=i.tagName)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+2,r="",s="";if(o){const e=this.nodeBoundingClientRectUtil.getBoundingRectForLogicalNode(o),t=this.nodeBoundingClientRectUtil.isMouseCloserToBoundingClientRectLeftThanRight(this.mouseX,e);var a,l;if(t)r=`<${i.tagName}> ${this.getTextForNode(o)}`;else n+=null!==(a=null===(l=this.getTextForNode(o))||void 0===l?void 0:l.length)&&void 0!==a?a:0,r=`<${i.tagName}>${this.getTextForNode(o)} `;const c=t?e.left-2:e.left+e.width+1;s=this.getCustomStyle(e.height,e.top,c)}else{r=`<${i.tagName}> `;const e=this.nodeBoundingClientRectUtil.getBoundingClientRect(i.getDomNode());s=this.getCustomStyle(e.height-2,e.top+1,e.left+1)}this.topInsertionMarkerText="↓".padStart(n+1," "),this.codeText=r,this.customStyle=s}getTextForNode(e){return e?"Element"===e.type?`<${e.tagName}>`:"Text"===e.type?null===(t=e.text)||void 0===t?void 0:t.slice(0,20):"":"";var t}};pf([Es],gf.prototype,"mouseX",void 0),pf([Es],gf.prototype,"mouseY",void 0),pf([Es({mode:"boolean"})],gf.prototype,"isVisible",void 0),pf([Aa],gf.prototype,"nodesFromAreaUtil",void 0),pf([Fa],gf.prototype,"nodeBoundingClientRectUtil",void 0),pf([xa],gf.prototype,"browserLink",void 0),pf([Hr],gf.prototype,"topInsertionMarkerText",void 0),pf([Hr],gf.prototype,"codeText",void 0),pf([Hr],gf.prototype,"customStyle",void 0),gf=pf([Bs({name:"drag-and-drop-insertion-point",template:hf,styles:uf})],gf);var ff,vf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};!function(e){e[e["StartMenuItem"]=0]="StartMenuItem",e[e["CheckboxMenuItem"]=1]="CheckboxMenuItem"}(ff||(ff={}));class bf{constructor(e){this.shouldDismissMenu=!0,this.menuItemType=ff.StartMenuItem,Object.assign(this,e)}}class mf{constructor(e){this.shouldDismissMenu=!1,this.menuItemType=ff.CheckboxMenuItem,Object.assign(this,e)}}vf([Hr],mf.prototype,"isCheckboxChecked",void 0);const yf=Ih();function wf(e,t,i,o,n){return i?`${e.imageRootUrl}images/${t}/backgroundColor/${encodeURIComponent((r=e,Ed.getValueFor(r).toColorString()))}`:o&&n?`${e.imageRootUrl}images/${t}_${n}`:`${e.imageRootUrl}images/${t}`;var r}const xf=ws` t.parent.handleItemChangeEvent(e,t)}> ${xs((e=>e.icon),ws` wf(t.parent,e.icon,e.iconRespectsBackgroundColor,e.iconIsThemed,yf.name)} />`)} ${e=>e.text} `,kf=ws` e.isCheckboxChecked} @change=${(e,t)=>t.parent.handleItemChangeEvent(e,t)}> ${e=>e.text} `,Sf=ws` `,Cf=Br` .menu_background { position: fixed; left: 0; right: 0; top: 0; bottom: 0; } fast-menu { --design-unit: 3; } fast-menu-item img { height: 16px; width: 16px; } `;class $f{constructor(){this._rootUrl=null}get rootUrl(){return this._rootUrl||this.findRootUrl(),this._rootUrl}findRootUrl(){const e=document.getElementById(pr.browserLinkScriptElementId).src,t=e.substr(0,e.length-"browserLink".length);this._rootUrl=t}}var Nf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let Ef=class extends Fs{constructor(){super(),this.handleEscapeKeyPressed=e=>{e.preventDefault(),this.$emit("lightDismiss")};const e=new $f;this.imageRootUrl=e.rootUrl}connectedCallback(){super.connectedCallback(),this.menuMouseTrap=vr(this.menuNode),this.menuMouseTrap&&this.menuMouseTrap.bind(dr.escape,this.handleEscapeKeyPressed),this.previousArrowKeyMode=this.hotkeyManagerService.arrowKeyMode,this.hotkeyManagerService.arrowKeyMode=Lg.MENU_NAVIGATION}disconnectedCallback(){super.disconnectedCallback(),this.hotkeyManagerService&&this.previousArrowKeyMode&&(this.hotkeyManagerService.arrowKeyMode=this.previousArrowKeyMode),this.menuMouseTrap&&this.menuMouseTrap.unbind(dr.escape)}handleLightDismiss(){this.$emit("lightDismiss")}trapClick(e){e.stopPropagation(),e.preventDefault()}handleItemChangeEvent(e,t){var i;t.event.stopPropagation(),t.event.preventDefault(),this.$emit("menuItemClicked",{menuItem:e}),null==e||null===(i=e.callback)||void 0===i||i.call(e)}handleAnchoredRegionLoaded(){var e;null===(e=this.menuNode)||void 0===e||e.focus()}};Nf([Hr],Ef.prototype,"items",void 0),Nf([_a],Ef.prototype,"hotkeyManagerService",void 0),Nf([Hr],Ef.prototype,"menuNode",void 0),Nf([Hr],Ef.prototype,"imageRootUrl",void 0),Nf([Hr],Ef.prototype,"anchorElement",void 0),Nf([Hr],Ef.prototype,"anchoredRegion",void 0),Nf([Hr],Ef.prototype,"menuBackground",void 0),Ef=Nf([Bs({name:"wlp-menu",template:Sf,styles:Cf})],Ef);var Lf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const Tf=Ih(),Of=Br` :host { height: inherit; } fast-button { border-radius: 0; height: inherit; } .img { height: 16px; width: 16px } `,_f=ws` e.toggleMenu()} ${Ss("buttonElement")}> `${e.rootUrl}images/VisualStudio_${Tf.name}`} /> ${xs((e=>e.isMenuOpen),ws` e.menuItems} :anchorElement=${e=>e.buttonElement} @lightDismiss=${e=>e.dismissMenu()} @menuItemClicked=${(e,t)=>e.handleMenuItemClicked(An(t))}/> `)} `;let If=class extends Fs{constructor(){super(),this.isMenuOpen=!1;const e=new $f;this.rootUrl=e.rootUrl}toggleMenu(){this.isMenuOpen=!this.isMenuOpen}dismissMenu(){this.isMenuOpen=!1}handleMenuItemClicked(e){this.isMenuOpen=!e.menuItem.shouldDismissMenu}};Lf([Hr],If.prototype,"isMenuOpen",void 0),Lf([Es],If.prototype,"rootUrl",void 0),Lf([Hr],If.prototype,"menuItems",void 0),Lf([Hr],If.prototype,"buttonElement",void 0),If=Lf([Bs({name:"wlp-menu-button",template:_f,styles:Of})],If);const Df=Br` .overlay { position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; font: var(--body-font); z-index: var(--wlp-zIndex); } `,Rf=ws`
e.handleClick(t.event)} @dblclick=${(e,t)=>e.handleDoubleClick(t.event)} @dragenter=${(e,t)=>e.handleDrag(t.event)} @dragover=${(e,t)=>e.handleDrag(t.event)} @drop=${(e,t)=>e.handleDrop(t.event)} @dragleave=${e=>e.handleDragLeave()} @mousemove=${(e,t)=>e.handleMouseMove(t.event)}> e.actionPanelDetails.hasActionItems} draggable="true" @dragstart=${(e,t)=>e.handleDragStart(t.event)} @dragend=${(e,t)=>e.handleDragEnd(t.event)} @selectionTagClicked=${(e,t)=>e.handleSelectionTagClicked(An(t))} @layoutUpdated=${e=>e.handleSelectorDecoratorLayoutUpdated()}> e.dragMouseX} mouseY=${e=>e.dragMouseY} ?isVisible=${e=>e.isDragAndDropInsertionPointVisible}>
${xs((e=>e.isActionPanelVisible),ws` e.actionPanelDetails.title} :actionItems=${e=>e.actionPanelDetails.actionItems} :anchorElement=${e=>e.actionPanelDetails.anchorElement} @methodExecuted=${(e,t)=>e.handleActionPanelMethodExecuted(An(t))} @updateProperty=${(e,t)=>e.handleActionPanelUpdateProperty(An(t))}> `)} `;var Pf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class Af{constructor(){this.actionItems=null}get hasActionItems(){var e;return(null===(e=this.actionItems)||void 0===e?void 0:e.length)>0}}Pf([Hr],Af.prototype,"actionItems",void 0),Pf([Hr],Af.prototype,"title",void 0),Pf([Hr],Af.prototype,"anchorElement",void 0);let Ff=class extends Fs{constructor(){super(...arguments),this.dragMouseX=-1,this.dragMouseY=-1,this.isDragAndDropInsertionPointVisible=!1,this.isActionPanelVisible=!1,this.actionPanelDetails=new Af,this.onSelectedNodeChanged=()=>{this.isActionPanelVisible=!1,this.configureForSelectedNode(this.selectionService.selectedLogicalNode)},this.onScroll=()=>{var e;null===(e=this.actionPanel)||void 0===e||e.forceAnchorUpdate()},this.onWindowResize=()=>{var e;null===(e=this.actionPanel)||void 0===e||e.forceAnchorUpdate()},this.handleTextEditingHotKey=e=>{e.preventDefault();const t=this.selectionService.selectedLogicalNode;t&&(this.simpleTextEditingService.textNodeBeingEdited=t.getDomNode())},this.handleEnterKey=e=>{var t;!0===(null===(t=this.quickEditingService)||void 0===t?void 0:t.handleEnterKey(this.selectionService.selectedLogicalNode))&&e.preventDefault()}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.onWindowResize),window.addEventListener("scroll",this.onScroll),vr.bind(dr.enterTextEditingMode,this.handleTextEditingHotKey),vr.bind(dr.enter,this.handleEnterKey),this.overlaySurfaceNode&&(this._overlaySurfaceMousetrapInstance=vr(this.overlaySurfaceNode),this.overlaySurfaceNode.focus()),this.designSurfaceService.selectionOverlayElement=this.overlaySurfaceNode,this.setArrowKeyMode(),this.attachBrowserLinkEvents(),this.configureForSelectedNode(this.selectionService.selectedLogicalNode)}disconnectedCallback(){var e;super.disconnectedCallback(),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("scroll",this.onScroll),vr.unbind(dr.enterTextEditingMode),vr.unbind(dr.enter),null===(e=this._actionPanelMousetrapInstance)||void 0===e||e.unbind(dr.escape),this.detachBrowserLinkEvents()}actionPanelChanged(e,t){if(null==e)this._actionPanelMousetrapInstance=vr(this.actionPanel),this._actionPanelMousetrapInstance.bind(dr.escape,(()=>this.isActionPanelVisible=!1));else if(null==t){var i;null===(i=this._actionPanelMousetrapInstance)||void 0===i||i.unbind(dr.escape)}}setArrowKeyMode(){this.overlaySurfaceNode&&this.hotkeyManagerService.setArrowKeyModeAssociatedNode(Lg.NORMAL_NAVIGATION,this.overlaySurfaceNode)}attachBrowserLinkEvents(){var e;this.selectionService.selectionChanged.subscribe(this.onSelectedNodeChanged),null===(e=this._overlaySurfaceMousetrapInstance)||void 0===e||e.bind(hr.normalNavigation,this.hotkeyManagerService.onArrowKeyPressed.bind(this.hotkeyManagerService))}detachBrowserLinkEvents(){var e;this.selectionService.selectionChanged.unsubscribe(this.onSelectedNodeChanged),null===(e=this._overlaySurfaceMousetrapInstance)||void 0===e||e.unbind(hr.normalNavigation)}configureForSelectedNode(e){this.updateActionItems(e,!1)}async updateActionItems(e,t){t||(this.actionPanelDetails.actionItems=[],this.actionPanelDetails.title=""),e&&(this.actionPanelDetails.actionItems=await this.browserLink.actionPanelService.getActionItems(e),this.actionPanelDetails.hasActionItems&&(this.actionPanelDetails.title=function(e){let t="Unknown";if(e)if("Element"===e.type){let n=!1;if(e.attributes)for(const r of e.attributes){var i,o;if("ID"===(null===(i=r.name)||void 0===i?void 0:i.toUpperCase())&&(null===(o=r.value)||void 0===o?void 0:o.length)>0){t=r.value,n=!0;break}}!n&&e.tagName&&(t=e.tagName.replace("asp:",""))}else"CodeBlock"===e.type?t=r(e).codeBlockType:"GenericContainer"===e.type?t=Nn("logicalNodeShortNames.genericContainer"):"Root"===e.type?t=Nn("logicalNodeShortNames.root"):"Attribute"===e.type&&(t=e.name.toLowerCase());return Nn("actionPanel.title",{nodeName:t})}(e)))}handleSelectionTagClicked(e){this.actionPanelDetails.anchorElement=e.selectionTag,this.isActionPanelVisible=!this.isActionPanelVisible,1==this.isActionPanelVisible&&this.browserLink.telemetryService.sendActionPanelOpened(this.actionPanelDetails.anchorElement.textContent)}handleActionPanelMethodExecuted(e){const t=this.selectionService.selectedLogicalNode;t&&(this.browserLink.actionPanelService.executeMethod(t,e.memberName,e.relatedComponentMemberName),this.updateActionItems(t,!0))}handleActionPanelUpdateProperty(e){const t=this.selectionService.selectedLogicalNode;t&&(this.browserLink.actionPanelService.updateProperty(t,e.memberName,e.newValue,e.relatedComponentMemberName),this.updateActionItems(t,!0))}handleSelectorDecoratorLayoutUpdated(){var e;null===(e=this.actionPanel)||void 0===e||e.forceAnchorUpdate()}handleMouseMove(e){if(this.isConnected&&this.selectionService){const t=In(this.nodesFromAreaUtil.nodeFromPoint(e.clientX,e.clientY),this.browserLink);t&&this.selectionService.isNodeSelectable(t)?this.style.cursor=gr:this.style.cursor=fr}}handleClick(e){this.browserLink.diagnosticLog.writeEvent(7536);const t=this.nodesFromAreaUtil.nodeFromPoint(e.clientX,e.clientY);t&&this.selectionService.selectAtLocation(t,e.clientX,e.clientY),this.overlaySurfaceNode&&this.overlaySurfaceNode.focus()}handleDoubleClick(e){e.preventDefault();const t=this.nodesFromAreaUtil.nodeFromPoint(e.clientX,e.clientY);if(t){this.selectionService.selectAtLocation(t,e.clientX,e.clientY);const i=this.selectionService.selectedLogicalNode;i&&"Text"!==i.type?this.browserLink.defaultActionService.doDefaultAction(i):this.simpleTextEditingService.textNodeBeingEdited=t}}handleDragStart(e){const t=this.selectionService.getFirstSelectedDomNode();return!(!a(t)&&"Text"!==this.selectionService.selectedLogicalNode.type)&&(!!Pn(this.browserLink,this.selectionService.selectedLogicalNode)&&(a(t)&&e.dataTransfer.setDragImage(t,0,0),this.selectionService.isSelectedNodeDragging=!0,!0))}handleDrag(e){const t=this.nodesFromAreaUtil.getDroppableLogicalContainerNodeAtPoint(e.clientX,e.clientY,this.browserLink.logicalTree,this.nodeBoundingClientRectUtil);if(!Pn(this.browserLink,t))return e.dataTransfer.dropEffect="none",e.dataTransfer.effectAllowed="none",void(this.isDragAndDropInsertionPointVisible=!1);this.selectionService.isSelectedNodeDragging&&function(e,t){return Rn.areCoordinatesInsideLogicalNode(e.clientX,e.clientY,t)?(e.dataTransfer.dropEffect="none",e.dataTransfer.effectAllowed="none",!1):(e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",!0)}(e,this.selectionService.selectedLogicalNode)||Bn(e,t)?(this.dragMouseX=e.clientX,this.dragMouseY=e.clientY,this.isDragAndDropInsertionPointVisible=!0):this.isDragAndDropInsertionPointVisible=!1}handleDragLeave(){this.resetDragAndDropState(!1)}handleDragEnd(e){this.resetDragAndDropState()}handleDrop(e){let t="";try{t=e.dataTransfer.getData("text/html");const i=e.clientX,o=e.clientY,n=this.nodesFromAreaUtil.getDroppableLogicalContainerNodeAtPoint(i,o,this.browserLink.logicalTree,this.nodeBoundingClientRectUtil);if(!n){const e="handleDrop() failed - no parent container element to drop into could be found.";return void this.sendHandleDropFailed(e,t)}let r=this.nodesFromAreaUtil.getClosestNonWhitespaceLogicalChildNodeAtPoint(i,o,n,this.nodeBoundingClientRectUtil);if(r){const e=this.nodeBoundingClientRectUtil.getBoundingRectForLogicalNode(r);e&&this.nodeBoundingClientRectUtil.isMouseCloserToBoundingClientRectLeftThanRight(i,e)&&(r=this.getPrecedingNonWhitespaceSiblingLogicalNode(n,r))}Fn(this.browserLink,n,r,this.selectionService.isSelectedNodeDragging,e)}catch(e){let i=e instanceof Error?e.message+"\r\n"+e.stack:"Unknown Error";i="handleDrop() failed - "+i,this.sendHandleDropFailed(i,t)}finally{this.resetDragAndDropState()}}sendHandleDropFailed(e,t){this.browserLink.diagnosticLog.writeMessageForEvent(7549,e+" dropData is: "+t,2),this.browserLink.telemetryService.sendDragAndDropFailed(t,e)}resetDragAndDropState(e=!0){this.dragMouseX=-1,this.dragMouseY=-1,this.isDragAndDropInsertionPointVisible=!1,e&&(this.selectionService.isSelectedNodeDragging=!1)}getPrecedingNonWhitespaceSiblingLogicalNode(e,t){for(let i=1;i=0;t--){const i=e.children[t];if(i&&("Text"!==i.type||i.text.trim()))return i}break}return null}};Pf([xa],Ff.prototype,"browserLink",void 0),Pf([Da],Ff.prototype,"designSurfaceService",void 0),Pf([Ca],Ff.prototype,"selectionService",void 0),Pf([_a],Ff.prototype,"hotkeyManagerService",void 0),Pf([Ea],Ff.prototype,"simpleTextEditingService",void 0),Pf([Aa],Ff.prototype,"nodesFromAreaUtil",void 0),Pf([Fa],Ff.prototype,"nodeBoundingClientRectUtil",void 0),Pf([Ba],Ff.prototype,"quickEditingService",void 0),Pf([Hr],Ff.prototype,"dragMouseX",void 0),Pf([Hr],Ff.prototype,"dragMouseY",void 0),Pf([Hr],Ff.prototype,"isDragAndDropInsertionPointVisible",void 0),Pf([Hr],Ff.prototype,"actionPanel",void 0),Pf([Hr],Ff.prototype,"isActionPanelVisible",void 0),Pf([Hr],Ff.prototype,"actionPanelDetails",void 0),Ff=Pf([Bs({name:"selection-overlay",template:Rf,styles:Df})],Ff);const Bf=ws` ${xs((e=>!e.selectionIsText),ws`
e.divStyle}>
`)} ${xs((e=>e.selectionIsText),ws` ${Xg((e=>e.highlights),ws` e.tagLocation} displayText=${e=>e.displayText} contentPreview=${e=>e.contentPreview} height=${e=>e.height} width=${e=>e.width} top=${e=>e.top} left=${e=>e.left} hasTag=${(e,t)=>{return i=e,t.isFirst&&"Top"===i.tagLocation||function(e,t){return t.isLast&&"Bottom"===e.tagLocation}(e,t);var i}}> `,{positioning:!0})} `)} `,Mf=Br` .selectionTag { background-color: ${xg}; display: flex; position: absolute; font-weight: bold; white-space: nowrap; align-items: center; padding: 3px 10px; border-radius: 3px; box-sizing: border-box; box-shadow: var(--wlp-box-shadow); color: ${kg}; font-family: var(--body-font); font-size: var(--type-ramp-base-font-size); cursor: default; } :host([tagLocation="Inside"]) .selectionTag { opacity: 0.85; } :host([tagLocation="Top"]) .selectionTag { top: calc(-1 * var(--wlp-status-bar-height)); left: 0; } :host([tagLocation="Top"]) .selectionTag::after { box-sizing: border-box; content: " "; position: absolute; left: 25%; margin-left: -5px; border-width: 5px; border-style: solid; top: 100%; border-color: ${xg} transparent transparent transparent; } :host([tagLocation="Bottom"]) .selectionTag { bottom: calc(-1 * var(--wlp-status-bar-height)); left: 0; } :host([tagLocation="Bottom"]) .selectionTag::after { box-sizing: border-box; content: " "; position: absolute; left: 25%; margin-left: -5px; border-width: 5px; border-style: solid; bottom: 100%; border-color: transparent transparent ${xg} transparent; } `,Vf=Br` #elementOutline { position: fixed; border-style: solid; border-width: 1px; border-color: ${xg}; outline-style: none; height: 0px; width: 0px; top: 0px; left: -100px; } ${Mf} :host([hasActionItems]) .selectionTag { cursor: pointer; } .actionPanelIndicator { display: none; margin-left: 5px; } :host([hasActionItems]) .actionPanelIndicator { display: inline; } `;function jf(e){const t=function(e){for(var t;e&&!r(e).mapsToDom;)e=e.parent;for(;e&&e.getDomNode()&&e.getDomNode().nodeType!==Node.ELEMENT_NODE;)e=e.parent;return null===(t=e)||void 0===t?void 0:t.getDomNode()}(e);if(t&&!function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}(t)){const e={block:(new c).getBoundingClientRect(t).height>document.documentElement.clientHeight?"start":"center",inline:"center"};t.scrollIntoView(e)}}function zf(e){let t=1/0,i=1/0,o=-1/0,n=-1/0;for(const r of e)r&&r.left!==1/0&&r.top!==1/0&&r.right!==-1/0&&r.bottom!==-1/0&&(t=r.lefto?r.right:o,n=r.bottom>n?r.bottom:n);return function(e,t,i,o){return e!==1/0&&t!==1/0&&i!==-1/0&&o!==-1/0}(t,i,o,n)?DOMRect.fromRect({x:t,y:i,width:o-t,height:n-i}):null}function Hf(...e){const t=e.map((e=>{if(!e)return null;if(e.nodeType==Node.TEXT_NODE){const t=e;if(t.parentNode){const e=document.createRange();e.selectNode(t);return zf(e.getClientRects())}return null}if(e.nodeType==Node.ELEMENT_NODE){return e.getBoundingClientRect()}}));return zf(t)}var Uf,qf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class Kf{constructor(){this.contentPreview=""}}qf([Hr],Kf.prototype,"displayText",void 0),qf([Hr],Kf.prototype,"contentPreview",void 0),qf([Hr],Kf.prototype,"height",void 0),qf([Hr],Kf.prototype,"width",void 0),qf([Hr],Kf.prototype,"top",void 0),qf([Hr],Kf.prototype,"left",void 0),qf([Hr],Kf.prototype,"tagLocation",void 0);let Wf=Uf=class extends Fs{constructor(){super(...arguments),this.contentPreview="",this.tagLocation="Top",this.hasActionItems=!1,this.onExpansionOnEmptyElementsChanged=()=>{this.updateProperties()},this.onSelectedNodeChanged=()=>{this.configureForSelectedNode(!0)},this.onScroll=()=>{this.updateProperties()},this.onWindowResize=()=>{this.updateProperties(),this.keyboardNavigationService.serviceInitialized&&this.keyboardNavigationService.updatePositionMap()},this.onChangesApplied=()=>{this.configureForSelectedNode(!1),this.keyboardNavigationService.serviceInitialized&&this.keyboardNavigationService.updatePositionMap()}}handleSelectionTagClick(e){this.hasActionItems&&(e.stopPropagation(),e.preventDefault(),this.$emit("selectionTagClicked",{selectionTag:this.selectionTag}))}getHighlights(e,t){const i=[];if(0===e.length)return i;const o=Uf.selectionTagNameHeight;let n;const r=window.innerHeight-e[e.length-1].bottom;n=e[0].top0)if(1===this.selectedDomNodes.length&&this.selectedDomNodes[0].nodeType===Node.TEXT_NODE){this.tagLocation="Top",this.selectionIsText=!0;const e=this.selectedDomNodes[0];if(e.parentNode){const t=document.createRange();t.selectNode(e);const i=t.getClientRects();this.highlights=this.getHighlights(i,this.displayText)}else this.highlights=[]}else{this.selectionIsText=!1;const e=Hf(...this.selectedDomNodes);e&&(t.height=e.height+2,t.width=e.width+2,t.top=e.top-2,t.left=e.left-2);const i=Uf.selectionTagNameHeight,o=window.innerHeight-(t.top+t.height);t.topUf.contentPreviewTrimLength?o.substring(0,Uf.contentPreviewTrimLength-3)+"…":o)}configureForSelectedNode(e){const t=this.selectionService.selectedLogicalNode,i=En(t).truncatedText;this.displayText=i,this.setContentPreviewText(t),this.selectedDomNodes=this.selectionService.getAllSelectedDomNodes(),this.updateProperties(),e&&jf(this.selectionService.selectedLogicalNode)}};Wf.selectionTagNameHeight=23,Wf.contentPreviewTrimLength=40,qf([Hr],Wf.prototype,"displayText",void 0),qf([Hr],Wf.prototype,"contentPreview",void 0),qf([Hr],Wf.prototype,"selectedDomNodes",void 0),qf([xa],Wf.prototype,"browserLink",void 0),qf([Ca],Wf.prototype,"selectionService",void 0),qf([Ra],Wf.prototype,"expandEmptyElementsService",void 0),qf([La],Wf.prototype,"keyboardNavigationService",void 0),qf([Es],Wf.prototype,"tagLocation",void 0),qf([Hr],Wf.prototype,"divStyle",void 0),qf([Hr],Wf.prototype,"highlights",void 0),qf([Hr],Wf.prototype,"selectionIsText",void 0),qf([Hr],Wf.prototype,"selectionTag",void 0),qf([Es({mode:"boolean"})],Wf.prototype,"hasActionItems",void 0),Wf=Uf=qf([Bs({name:"selector-decorator",template:Bf,styles:Vf})],Wf);const Gf=ws`
e.customStyle}> ${xs((e=>e.hasTag),ws` e.customTextStyle}>${e=>e.displayText} `)}
`,Xf=Br` ${Mf} .highlight { position: fixed; background-color: ${yg}; } `;var Yf=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let Qf=class extends Fs{get customStyle(){return`height: ${this.height}px;`+`width: ${this.width}px;`+`top: ${this.top}px;`+`left: ${this.left}px;`}get customTextStyle(){return"Inside"===this.tagLocation?`top: ${2+this.top<0?-this.top:0}px;`+`left: ${2+this.left<0?-this.left:0}px;`:""}};Yf([Es],Qf.prototype,"displayText",void 0),Yf([Es],Qf.prototype,"contentPreview",void 0),Yf([Es],Qf.prototype,"height",void 0),Yf([Es],Qf.prototype,"width",void 0),Yf([Es],Qf.prototype,"top",void 0),Yf([Es],Qf.prototype,"left",void 0),Yf([Es],Qf.prototype,"tagLocation",void 0),Yf([Es({mode:"boolean"})],Qf.prototype,"hasTag",void 0),Yf([Ur],Qf.prototype,"customTextStyle",null),Qf=Yf([Bs({name:"selector-decorator-text-highlight",template:Gf,styles:Xf})],Qf);const Zf=ws`
`,Jf=Br` :host(:not([isVisible])) .insertionCursor, :host(:not([isVisible])) fast-anchored-region { display: none; } :host([isVisible]) .insertionCursor { position: fixed; border-style: solid; border-width: 1; border-top-color: white; border-bottom-color: black; border-left-color: white; border-right-color: black; width: 0; animation: blink 1.0s steps(2) infinite; } .insertionCursor { pointer-events: none; } @keyframes blink { 0% { opacity: 0; } } `;var ev=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};class tv extends Fs{constructor(){super(...arguments),this.onSelectedNodeChanged=()=>{this.configureForSelectedNode()},this.onScroll=()=>{this.updateProperties()},this.onWindowResize=()=>{this.updateProperties()},this.onChangesApplied=()=>{this.updateProperties()}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.onWindowResize),window.addEventListener("scroll",this.onScroll),this.attachBrowserLinkEvents(),this.configureForSelectedNode()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("scroll",this.onScroll),this.detachBrowserLinkEvents()}attachBrowserLinkEvents(){this.selectionService.selectionChanged.subscribe(this.onSelectedNodeChanged),this.browserLink.autoSyncService.changesApplied.subscribe(this.onChangesApplied)}detachBrowserLinkEvents(){this.selectionService.selectionChanged.unsubscribe(this.onSelectedNodeChanged),this.browserLink.autoSyncService.changesApplied.unsubscribe(this.onChangesApplied)}configureForSelectedNode(){this.currentSelectedNode=this.selectionService.selectedLogicalNode,this.currentParent=this.selectionService.parentNode,this.currentPriorSibling=this.selectionService.priorSiblingNode,this.updateProperties()}updateProperties(){}}ev([xa],tv.prototype,"browserLink",void 0),ev([Ca],tv.prototype,"selectionService",void 0);var iv=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let ov=class extends tv{updateProperties(){if(this.isConnected&&this.currentParent&&!this.currentSelectedNode)if(this.isVisible=!0,this.currentPriorSibling){const e=this.nodeBoundingClientRectUtil.getBoundingRectForLogicalNode(this.currentPriorSibling);if(e){const t=e.left+e.width+1;this.setSizeAndLocation(e.height,e.top,t)}}else{const e=this.currentParent.getDomNode();if(e){const t=this.nodeBoundingClientRectUtil.getBoundingClientRect(e);t&&this.setSizeAndLocation(t.height-2,t.top+1,t.left+1)}}else this.isVisible=!1}setSizeAndLocation(e,t,i){this.insertionCursor.style.height=`${e}px`,this.insertionCursor.style.top=`${t}px`,this.insertionCursor.style.left=`${i}px`}};iv([Es({mode:"boolean"})],ov.prototype,"isVisible",void 0),iv([Aa],ov.prototype,"nodesFromAreaUtil",void 0),iv([Fa],ov.prototype,"nodeBoundingClientRectUtil",void 0),ov=iv([Bs({name:"selector-insertion-decorator",template:Zf,styles:Jf})],ov);const nv=ws`
e.handleOutlineClick(t.event)} id="outer-top">
e.handleOutlineClick(t.event)} id="outer-left">
e.handleOutlineClick(t.event)} id="outer-right">
e.handleOutlineClick(t.event)} id="outer-bottom">
`,rv=5,sv=`${rv}px`,av=Br` #elementOutline { position: fixed; height: 0px; width: 0px; top: 0px; left: -100px; display: grid; grid-template-columns: ${sv} 1fr ${sv}; grid-template-rows: ${sv} 1fr ${sv}; } #outer-top, #outer-left, #outer-right, #outer-bottom { background-image: linear-gradient(to right top, transparent 40%, ${xg} 40%, ${xg} 60%, transparent 60%); background-size: ${sv} ${sv}; cursor: move; } #outer-top { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 1; } #outer-left { grid-column-start: 1; grid-column-end: 1; grid-row-start: 2; grid-row-end: 2; } #outer-right { grid-column-start: 3; grid-column-end: 3; grid-row-start: 2; grid-row-end: 2; } #outer-bottom { grid-column-start: 1; grid-column-end: 4; grid-row-start: 3; grid-row-end: 3; } `;var lv=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let cv=class extends tv{updateProperties(){const e={top:0,left:-100,height:0,width:0};if(this.currentParent&&!this.currentSelectedNode){const t=this.currentParent.getDomNode();if(t){const i=Hf(t);i&&(e.top=i.top-rv,e.left=i.left-rv,e.height=i.height+2*rv,e.width=i.width+2*rv)}}this.setSizeAndLocation(e.top,e.left,e.height,e.width)}handleOutlineClick(e){this.selectionService.selectLogicalNode(this.currentParent),e.stopPropagation()}setSizeAndLocation(e,t,i,o){this.elementOutline.style.top=`${e}px`,this.elementOutline.style.left=`${t}px`,this.elementOutline.style.height=`${i}px`,this.elementOutline.style.width=`${o}px`}};cv=lv([Bs({name:"selector-parent-decorator",template:nv,styles:av})],cv);var dv=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const hv=Br` :host { height: var(--wlp-status-bar-height); } `,uv=ws` e.menuItems}> ${xs((e=>e.showCloseDialog),ws` e.closeDialogDismissed()}> `)} `;let pv=class extends Fs{constructor(){super(...arguments),this.onExpansionOnEmptyElementsChanged=()=>{var e,t;this._expandEmptyElementsMenuItem.isCheckboxChecked=null!==(e=null===(t=this.expandEmptyElementsService)||void 0===t?void 0:t.isExpansionOnEmptyElementsEnabled)&&void 0!==e&&e}}connectedCallback(){super.connectedCallback(),this.getMenuItems(),this.expandEmptyElementsService.isExpansionOnEmptyElementsEnabledChanged.subscribe(this.onExpansionOnEmptyElementsChanged)}disconnectedCallback(){super.disconnectedCallback(),this.expandEmptyElementsService.isExpansionOnEmptyElementsEnabledChanged.unsubscribe(this.onExpansionOnEmptyElementsChanged)}toggleMenu(){var e;null===(e=this.menuButton)||void 0===e||e.toggleMenu()}closeDialogDismissed(){this.showCloseDialog=!1}toggleDesignSurface(){this.designSurfaceService.isEnabled=!this.designSurfaceService.isEnabled}toggleExpandEmptyElementsSetting(){this.expandEmptyElementsService.isExpansionOnEmptyElementsEnabled=!this.expandEmptyElementsService.isExpansionOnEmptyElementsEnabled,this.getMenuItems()}handleCloseMenuItem(){this.showCloseDialog=!0}getMenuItems(){var e,t,i;let o;o=1==(null===(e=this.designSurfaceService)||void 0===e?void 0:e.isEnabled)?Nn("menu.disableInspector"):Nn("menu.enableInspector");const n=null!==(t=null===(i=this.expandEmptyElementsService)||void 0===i?void 0:i.isExpansionOnEmptyElementsEnabled)&&void 0!==t&&t;this._expandEmptyElementsMenuItem=new mf({text:Nn("menu.showEmptyElements"),isCheckboxChecked:n,hotKey:"Alt+Ctrl+X",callback:()=>this.toggleExpandEmptyElementsSetting()});const r=[this._expandEmptyElementsMenuItem,new bf({text:o,icon:"WebLivePreview",iconIsThemed:!0,hotKey:"Alt+Ctrl+I",callback:this.toggleDesignSurface.bind(this)}),new bf({text:Nn("menu.close"),hasDivider:!0,icon:"Close",iconRespectsBackgroundColor:!0,callback:this.handleCloseMenuItem.bind(this)})];this.menuItems=r}};dv([Da],pv.prototype,"designSurfaceService",void 0),dv([Ra],pv.prototype,"expandEmptyElementsService",void 0),dv([Hr],pv.prototype,"menuItems",void 0),dv([Hr],pv.prototype,"showCloseDialog",void 0),pv=dv([Bs({name:"wlp-start-button",template:uv,styles:hv})],pv);const gv=ws` `,fv=(Ih(),Br` :host { user-select: none; border-left: calc(var(--outline-width) * 1px) solid ${Ch}; height: 100%; pointer-events: none; } :host(.interactive) { cursor: pointer; pointer-events: auto; } :host(.interactive:hover) { background-color: ${Md}; color: ${Ud}; } .blinking-warning, .blinking-error { animation: blink 1s; animation-iteration-count: 3; color: black; font-weight: bold; } .blinking-error { background-color: #F55762; } .blinking-warning { background-color: #FFE39E; } .blinking-error:hover { background-color: #F8828A; } .blinking-warning:hover { background-color: #FFE9B3; } @keyframes blink { 50% { opacity: 0.3 } } img { height: 16px; width: 16px; margin-right: 5px; margin-top: 1px; } .child { display: flex; } .content { display: flex; align-items: center; height: 100%; padding: 0 calc((var(--base-horizontal-spacing-multiplier) + var(--density)) * var(--design-unit) * 1px); font-family: var(--body-font); font-size: var(--type-ramp-base-font-size); } `);var vv=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let bv=class extends Fs{constructor(){super();const e=new $f;this.rootUrl=e.rootUrl}displayTextChanged(e,t){this.statusTextDiv.classList.remove("blinking-warning"),this.statusTextDiv.classList.remove("blinking-error"),2===this.messageType?this.statusTextDiv.classList.add("blinking-error"):1===this.messageType&&this.statusTextDiv.classList.add("blinking-warning")}};vv([Hr],bv.prototype,"displayText",void 0),vv([Hr],bv.prototype,"fullText",void 0),vv([Hr],bv.prototype,"isUpdateButtonEnabled",void 0),vv([Hr],bv.prototype,"messageType",void 0),vv([Es],bv.prototype,"rootUrl",void 0),bv=vv([Bs({name:"status-text",template:gv,styles:fv})],bv);var mv=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};const yv=Br` :host { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; position: fixed; box-shadow: var(--wlp-box-shadow); height: var(--wlp-status-bar-height); width: 100%; bottom: 0; left: 0; font: var(--body-font); z-index: var(--wlp-zIndex); background-color: ${Ih().backgroundToken}; color: ${kh}; } :host([minimal]) { grid-template-columns: minmax(0, 1fr); } wlp-start-button { margin-right: 5px; } status-text { margin-left: 5px; } `,wv=ws` ${xs((e=>!e.minimal),ws` `)} ${xs((e=>!e.minimal),ws` {var t;return null===(t=e.currentStatus)||void 0===t?void 0:t.messageType}} :displayText=${e=>{var t;return null===(t=e.currentStatus)||void 0===t?void 0:t.displayText}} :fullText=${e=>{var t;return null===(t=e.currentStatus)||void 0===t?void 0:t.fullText}} :isUpdateButtonEnabled=${e=>e.isUpdateBrowserButtonEnabled} @click=${e=>e.handleClick()}> `)} `;let xv=class extends Fs{constructor(){super(...arguments),this.unsubscribedFromEvents=!1,this.handleStatusChanged=()=>{var e;const t=this.statusService.currentStatus;(null===(e=this.currentStatus)||void 0===e?void 0:e.displayText)!==Nn("status.updating")||t.displayText!==Nn("status.upToDate")?this.currentStatus=t:this.detachBrowserLinkEvents()},this.handleUpdateBrowserButtonEnabledChanged=()=>{this.isUpdateBrowserButtonEnabled=this.updateBrowserButtonService.isButtonEnabled}}connectedCallback(){super.connectedCallback(),this.currentStatus=this.statusService.currentStatus,this._statusBarMouseTrapInstance=br()(this),this._statusBarMouseTrapInstance.bind(hr.tagNavBarNavigation,this.handleArrowKeyNavigation.bind(this)),this.attachBrowserLinkEvents()}handleArrowKeyNavigation(e){if(!this.tagNavigatorNode)return;e.stopPropagation(),e.preventDefault();const t=this.shadowRoot.activeElement;if(t==this.startButton){if("ArrowRight"==e.key){this.tagNavigatorNode.content.children[0].focus()}}else if(t==this.tagNavigatorNode){const t=this.tagNavigatorNode.shadowRoot.activeElement;if("tagNavBar_tagItem"!=t.className)return;if("ArrowRight"==e.key){const e=t.nextElementSibling;e?e.focus():this.isUpdateBrowserButtonEnabled&&this.statusTextNode.focus()}else if("ArrowLeft"==e.key){const e=t.previousElementSibling;if(e)e.focus();else if(this.startButton){const e=this.startButton.menuButton.buttonElement;e&&e.focus()}}}else if(t==this.statusTextNode&&"ArrowLeft"==e.key){const e=this.tagNavigatorNode.content.childElementCount;this.tagNavigatorNode.content.children[e-1].focus()}}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._statusBarMouseTrapInstance)||void 0===e||e.unbind(hr.tagNavBarNavigation),this.detachBrowserLinkEvents()}toggleMenu(){var e;null===(e=this.startButton)||void 0===e||e.toggleMenu()}attachBrowserLinkEvents(){this.statusService.statusChanged.subscribe(this.handleStatusChanged),this.updateBrowserButtonService.isButtonEnabledChanged.subscribe(this.handleUpdateBrowserButtonEnabledChanged),this.unsubscribedFromEvents=!1}detachBrowserLinkEvents(){this.statusService.statusChanged.unsubscribe(this.handleStatusChanged),this.updateBrowserButtonService.isButtonEnabledChanged.unsubscribe(this.handleUpdateBrowserButtonEnabledChanged),this.unsubscribedFromEvents=!0}handleClick(){var e;null===(e=this.browserLink)||void 0===e||e.refreshBrowsersService.refreshAllBrowsers()}};mv([Es({mode:"boolean"})],xv.prototype,"minimal",void 0),mv([Hr],xv.prototype,"currentStatus",void 0),mv([Hr],xv.prototype,"isUpdateBrowserButtonEnabled",void 0),mv([Hr],xv.prototype,"unsubscribedFromEvents",void 0),mv([xa],xv.prototype,"browserLink",void 0),mv([Ta],xv.prototype,"statusService",void 0),mv([Ia],xv.prototype,"updateBrowserButtonService",void 0),xv=mv([Bs({name:"wlp-status-bar",template:wv,styles:yv})],xv);const kv=Br` :host { max-height: var(--wlp-status-bar-height); display: grid; grid-template-columns: max-content minmax(0, max-content) max-content; } .tagNavBar_container { max-height: var(--wlp-status-bar-height); white-space: nowrap; overflow-x: hidden; } .tagNavBar_contents { display: inline-block; } .tagNavBar_tagItem { cursor: pointer; } .tagNavBar_tagItem, .tagNavBar_scroller { user-select: none; display: inline-block; padding: var(--wlp-status-bar-padding); font-family: var(--body-font); font-size: var(--type-ramp-base-font-size); margin-top: 2px; margin-right: 2px; height: 14px; } .tagNavBar_tagItem:hover { background-color: ${Md}; color: ${qd}; } .tagNavBar_scroller { user-select: none; color: ${wh}; } :host([overflow-direction="left"]) #leftScroller, :host([overflow-direction="both"]) #leftScroller, :host([overflow-direction="right"]) #rightScroller, :host([overflow-direction="both"]) #rightScroller { cursor: pointer; font-weight: 500; color: inherit; } :host([overflow-direction="left"]) #leftScroller:hover, :host([overflow-direction="both"]) #leftScroller:hover, :host([overflow-direction="right"]) #rightScroller:hover, :host([overflow-direction="both"]) #rightScroller:hover { background-color: ${Md}; color: ${qd}; } div[data-selected="true"] { font-weight: bold; color: ${Ud}; background-color: ${xg}; } div[data-outlined="true"] { font-weight: bold; outline: solid 2px ${xg}; } `,Sv=ws` ${xs((e=>e.hasSelection),ws`
e.handleLeftScrollerClick()}><
${Xg((e=>e.currentTagList),ws`
t.parent.handleTagNavBarSelectionEvent(e,t.event)} @dragover=${(e,t)=>t.parent.handleDrag(e,t.event)} @drop=${(e,t)=>t.parent.handleDrop(e,t.event)} @keydown=${(e,t)=>t.parent.handleTagNavBarSelectionEvent(e,t.event)} title=${e=>e.fullText}> ${e=>e.truncatedText}
`)}
e.handleRightScrollerClick()}>>
`)} `;var Cv=void 0&&(void 0).__decorate||function(e,t,i,o){var n,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,i,s):n(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};let $v=class extends Fs{constructor(){super(...arguments),this.tagNavBarOverflow="none",this.handleWindowResize=()=>{this.isLoaded&&(this.checkTagNavBarOverflowAndSetState(),this.scrollSelectedTagElementIntoView())},this.scrollSelectedTagElementIntoView=()=>{if(this.isLoaded){const e=this.container.querySelectorAll('div[data-selected="true"]')[0];e&&e.scrollIntoView({behavior:"smooth"})}},this.checkTagNavBarOverflowAndSetState=()=>{const e=this.determineNavBarOverflow();this.tagNavBarOverflow!==e&&(this.tagNavBarOverflow=e)},this.onTagNavBarChanged=(e,t)=>{this.setTagsAndSelection(t.tagItemList,t.selectedTagItem,t.parentTagItem),Or.queueUpdate(this.tagNavBarUpdated)},this.tagNavBarUpdated=()=>{this.scrollSelectedTagElementIntoView(),this.checkTagNavBarOverflowAndSetState()}}get hasSelection(){var e;return!!((null===(e=this.currentTagList)||void 0===e?void 0:e.length)>0&&(this.selectedTagItem||this.parentTagItem))}get isLoaded(){return!!(this.container&&this.content&&this.hasSelection)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.handleWindowResize),this.isLoaded&&(this.checkTagNavBarOverflowAndSetState(),this.scrollSelectedTagElementIntoView()),this.setTagsAndSelection(this.tagNavigationService.tagItemList,this.tagNavigationService.selectedTagItem,this.tagNavigationService.parentTagItem),this.tagNavigationService.tagHierarchyChanged.subscribe(this.onTagNavBarChanged),vr.bind(hr.tagNavBarSelection,this.tagNavigationService.onNavigateHotKeyPressed.bind(this.tagNavigationService),"keyup")}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.handleWindowResize),this.tagNavigationService.tagHierarchyChanged.unsubscribe(this.onTagNavBarChanged),vr.unbind(hr.tagNavBarSelection,"keyup")}handleDrop(e,t){let i="";try{i=t.dataTransfer.getData("text/html");const o=e.logicalNode;let n;o.children&&o.children.length>0&&(n=this.getLastNonWhitespaceChild(o)),Fn(this.browserLink,o,n,this.selectionService.isSelectedNodeDragging,t)}catch(e){let t=e instanceof Error?e.message+"\r\n"+e.stack:"Unknown Error";t="tagNavigator handleDrop() failed - "+t,this.sendHandleDropFailed(t,i)}}handleDrag(e,t){var i,o,n;this.selectionService.isSelectedNodeDragging?(i=t.dataTransfer,o=e.logicalNode,n=this.selectionService.selectedLogicalNode,function(e,t){let i=e;do{if(i===t)return!1;i=i.parent}while(i);return!0}(o,n)?(i.dropEffect="move",i.effectAllowed="move"):(i.dropEffect="none",i.effectAllowed="none")):Pn(this.browserLink,e.logicalNode)?function(e,t){Bn(e,t)}(t,e.logicalNode):(t.dataTransfer.dropEffect="none",t.dataTransfer.effectAllowed="none"),t.stopPropagation()}handleTagNavBarSelectionEvent(e,t){if("keydown"===t.type){if("Enter"!==t.code)return!0}return e.logicalNode&&this.selectionService.selectLogicalNode(e.logicalNode),!1}handleLeftScrollerClick(){this.handleNavBarTranslateX(!0,15,70,10)}handleRightScrollerClick(){this.handleNavBarTranslateX(!1,15,70,10)}getLastNonWhitespaceChild(e){for(let t=e.children.length-1;t>=0;t--){const i=e.children[t];if("Text"!==i.type||i.text.trim())return i}return null}sendHandleDropFailed(e,t){this.browserLink.diagnosticLog.writeMessageForEvent(7549,e+" dropData is: "+t,2),this.browserLink.telemetryService.sendDragAndDropFailed(t,e)}handleNavBarTranslateX(e,t,i,o){if(this.isLoaded){let n=0;const r=setInterval(function(){e?this.container.scrollLeft-=o:this.container.scrollLeft+=o,n+=o,n>=i&&(window.clearInterval(r),this.checkTagNavBarOverflowAndSetState())}.bind(this),t)}}setTagsAndSelection(e,t,i){this.currentTagList=e,this.selectedTagItem=t,this.parentTagItem=i}determineNavBarOverflow(){if(this.isLoaded){const e=this.container.getBoundingClientRect(),t=Math.floor(e.right),i=Math.floor(e.left),o=this.content.getBoundingClientRect(),n=Math.floor(o.right),r=Math.floor(o.left);if(i>r&&tt)return"right"}return"none"}};Cv([Es({attribute:"overflow-direction"})],$v.prototype,"tagNavBarOverflow",void 0),Cv([Hr],$v.prototype,"currentTagList",void 0),Cv([Hr],$v.prototype,"selectedTagItem",void 0),Cv([Hr],$v.prototype,"parentTagItem",void 0),Cv([Oa],$v.prototype,"tagNavigationService",void 0),Cv([Ca],$v.prototype,"selectionService",void 0),Cv([xa],$v.prototype,"browserLink",void 0),Cv([Ur],$v.prototype,"hasSelection",null),$v=Cv([Bs({name:"wlp-tag-navigator",template:Sv,styles:kv})],$v);class Nv{constructor(e){this.browserLink=e,this._expansionStyle=`:not(area, base, br, col, hr, img, input, link, meta, param, command, keygen, source, live-preview-root):empty::before {\n content:" ";\n font-size: 12px;\n white-space: pre;\n }\n `,this._isExpansionEnabledChanged=new n.FK,br().bind(dr.toggleExpandEmptyElementsSetting,(()=>{this.isExpansionOnEmptyElementsEnabled=!this.isExpansionOnEmptyElementsEnabled}),"keydown")}get isExpansionOnEmptyElementsEnabledChanged(){return this._isExpansionEnabledChanged.asEvent()}get isExpansionOnEmptyElementsEnabled(){return this._isExpansionEnabled}set isExpansionOnEmptyElementsEnabled(e){const t=this._isExpansionEnabled;this._isExpansionEnabled=e,t!==e&&(e?this.addExpansionStyle():this.removeExpansionStyle(),this._isExpansionEnabledChanged.dispatch(this._isExpansionEnabled),this.browserLink.expandEmptyElementsHostService.setExpandEmptyElementsSettingInVS(this._isExpansionEnabled))}addExpansionStyle(){this._currentExpansionStyleElement=document.createElement("style"),this._currentExpansionStyleElement.innerHTML=this._expansionStyle,document.body.appendChild(this._currentExpansionStyleElement)}removeExpansionStyle(){document.body.removeChild(this._currentExpansionStyleElement)}}i(102);class Ev{constructor(e){this.inertAttributeAddedByWlpAttributeName="inert-attribute-added-by-wlp",this.enableUserInteractionsCallCount=1,this.handleDesignSurfaceStateChanged=()=>{this.browserLink.designSurfaceService.isEnabled?this.disableUserInteractionsOnUserPageRoots():this.enableUserInteractionsOnUserPageRoots()},this.bodyChildAddedCallback=e=>{if(!this.browserLink.designSurfaceService.isEnabled||0!==this.enableUserInteractionsCallCount)return;const t=e.target,i=t;i.parentNode===document.body&&a(t)&&i.tagName!==pr.livePreviewRootTagName.toUpperCase()&&i.id!==pr.browserLinkScriptElementId&&(i.hasAttribute("inert")||(i.setAttribute(this.inertAttributeAddedByWlpAttributeName,"true"),i.setAttribute("inert","")))},this.browserLink=e,this.browserLink.designSurfaceService.isEnabledChanged.subscribe(this.handleDesignSurfaceStateChanged),this.browserLink.designSurfaceService.isEnabled&&this.disableUserInteractionsOnUserPageRoots();document.body.addEventListener("DOMNodeInserted",this.bodyChildAddedCallback)}runUserPageInteractionFunction(e,t){if(this.browserLink.designSurfaceService.isEnabled){this.enableUserInteractionsOnUserPageRoots();let i=t;try{i=e()}catch{}return this.disableUserInteractionsOnUserPageRoots(),i}return e()}enableUserInteractionsOnUserPageRoots(){if(1!=++this.enableUserInteractionsCallCount)return;const e=document.body.children;if(e)for(const t of e)t.hasAttribute(this.inertAttributeAddedByWlpAttributeName)&&(t.removeAttribute(this.inertAttributeAddedByWlpAttributeName),t.hasAttribute("inert")&&t.removeAttribute("inert"))}disableUserInteractionsOnUserPageRoots(){if(0===this.enableUserInteractionsCallCount||0!=--this.enableUserInteractionsCallCount)return;const e=document.body.children;if(e)for(const t of e)t.tagName===pr.livePreviewRootTagName.toUpperCase()||t.id===pr.browserLinkScriptElementId||t.hasAttribute("inert")||(t.setAttribute(this.inertAttributeAddedByWlpAttributeName,"true"),t.setAttribute("inert",""))}}class Lv{constructor(){this.startTime=new Date}}class Tv{constructor(e){this.operations=new Ov,this.browserLink=e}handleEnterKey(e){if(!Pn(this.browserLink,e))return!1;const t=this.operations.createNewElement(e);var i;return!(null==t||!t.insertAfterNode||null==t||!t.textToInsert)&&(null===(i=this.browserLink.logicalTreeEditingService)||void 0===i||i.insertTextAfterSiblingNode(t.insertAfterNode,t.textToInsert),!0)}}class Ov{constructor(){this.elementsToDuplicatePattern=/(p|div|li)/i,this.elementsToCreateEmptyParagraphPattern=/h\d+/i,this.tableCellPattern=/td/i,this.tableRowPattern=/tr/i,this.blankSpace=" ",this.emptyParagraph=`

 

`}createNewElement(e){let t;if(t="Text"===e.type?e.parent:e,t){if(this.shouldDuplicate(t))return{insertAfterNode:t,textToInsert:this.duplicate(t)};if(this.shouldCreateEmptyParagraphTag(t))return{insertAfterNode:t,textToInsert:this.createEmptyParagraphTag()};if(this.shouldDuplicateTableRows(t)){const e=this.findTableRowAncestor(t);return{insertAfterNode:e,textToInsert:this.createTableRowShell(e)}}}return null}shouldDuplicate(e){return this.elementsToDuplicatePattern.test(e.tagName)}duplicate(e){const t=e.getDomNode();if(!t)return null;const i=_v(t);return i.innerHTML=this.blankSpace,i.outerHTML}shouldCreateEmptyParagraphTag(e){return this.elementsToCreateEmptyParagraphPattern.test(e.tagName)}createEmptyParagraphTag(){return this.emptyParagraph}shouldDuplicateTableRows(e){if(this.tableCellPattern.test(e.tagName)){const t=e.getDomNode();if(!t.nextElementSibling){if(!t.parentElement.nextElementSibling)return!0}}return!1}findTableRowAncestor(e){do{let t=e.parent;const i=t.getDomNode();if(i&&this.tableRowPattern.test(i.tagName))return t;t=t.parent}while(parent);return null}createTableRowShell(e){const t=e.getDomNode(),i=_v(t);for(const e of t.childNodes){const t=_v(e);t.innerHTML=this.blankSpace,i.appendChild(t)}return i.outerHTML}}function _v(e){const t=e.cloneNode(!1);return t.removeAttribute("id"),t}function Iv(e){const t=new Lv;return function(){try{return window.self!==window.top}catch(e){return!0}}()?(e.log("Skipping tools initialization due to IFrame detection"),{onConnected(){},themeChanged(e){}}):(function(e,t){const i=new Jn(e);e.addSharedService("selectionHostingService",i),e.addSharedService("wlpInitStartInfoService",t),e.addSharedService("toolsLifetimeService",new Ng(e)),e.addSharedService("selectionService",new Un(e)),e.addSharedService("browserLinkConnectionStatusService",new lr),e.addSharedService("logicalTreeInitializedStatusService",new cr),e.addSharedService("simpleTextEditingService",new Og(e)),e.addSharedService("keyboardNavigationService",new ir(e)),e.addSharedService("statusService",new or),e.addSharedService("tagNavigationService",new nr(e)),e.addSharedService("hotkeyManagerService",new Tg(e)),e.addSharedService("updateBrowserButtonService",new rr),e.addSharedService("designSurfaceService",new mr(e)),e.addSharedService("expandEmptyElementsService",new Nv(e)),e.addSharedService("disableUserPageInteractionsService",new Ev(e)),e.addSharedService("quickEditingService",new Tv(e)),window["livePreview"]=new ar(e)}(e,t),e.toolsLifetimeService.renderLivePreviewBrowserUI(),{onConnected:function(){e.log("Tools extension connected"),e.toolsLifetimeService.initialize()},themeChanged:function(t){e.toolsLifetimeService.updateToolsTheme(t)}})}},32:function(e,t,i){e.exports=i(399).default},441:function(e,t,i){var o;!function(n,r,s){if(n){for(var a,l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},c={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},d={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},h={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},u=1;u<20;++u)l[111+u]="f"+u;for(u=0;u<=9;++u)l[u+96]=u.toString();y.prototype.bind=function(e,t,i){var o=this;return e=e instanceof Array?e:[e],o._bindMultiple.call(o,e,t,i),o},y.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},y.prototype.trigger=function(e,t){var i=this;return i._directMap[e+":"+t]&&i._directMap[e+":"+t]({},e),i},y.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},y.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(m(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var i=e.composedPath()[0];i!==e.target&&(t=i)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},y.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},y.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);a=null},y.init=function(){var e=y(r);for(var t in e)"_"!==t.charAt(0)&&(y[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},y.init(),n.Mousetrap=y,1&&e.exports&&(e.exports=y),1&&(void 0===(o=function(){return y}.call(t,i,t,e))||(e.exports=o))}function p(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i)}function g(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return l[e.which]?l[e.which]:c[e.which]?c[e.which]:String.fromCharCode(e.which).toLowerCase()}function f(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,i){return i||(i=function(){if(!a)for(var e in a={},l)e>95&&e<112||l.hasOwnProperty(e)&&(a[l[e]]=e);return a}()[e]?"keydown":"keypress"),"keypress"==i&&t.length&&(i="keydown"),i}function b(e,t){var i,o,n,r=[];for(i=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),n=0;n1?u(e,a,i,o):(s=b(e,o),t._callbacks[s.key]=t._callbacks[s.key]||[],c(s.key,s.modifiers,{type:s.action},n,e,r),t._callbacks[s.key][n?"unshift":"push"]({callback:i,modifiers:s.modifiers,action:s.action,seq:n,level:r,combo:e}))}t._handleKey=function(e,t,i){var o,n=c(e,t,i),r={},h=0,u=!1;for(o=0;o-1&&this._subscriptions.splice(t,1)}},e.prototype.asEvent=function(){return this._wrap},e.prototype.clear=function(){this._subscriptions.splice(0,this._subscriptions.length)},e}();t.DispatcherBase=s;var a=function(){function e(){this._events={}}return e.prototype.get=function(e){var t=this._events[e];return t||(t=this.createDispatcher(),this._events[e]=t,t)},e.prototype.remove=function(e){delete this._events[e]},e}();t.EventListBase=a;var l=function(){function e(e){this._subscribe=function(t){return e.subscribe(t)},this._unsubscribe=function(t){return e.unsubscribe(t)},this._one=function(t){return e.one(t)},this._has=function(t){return e.has(t)},this._clear=function(){return e.clear()},this._count=function(){return e.count}}return Object.defineProperty(e.prototype,"count",{get:function(){return this._count()},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){return this._subscribe(e)},e.prototype.sub=function(e){return this.subscribe(e)},e.prototype.unsubscribe=function(e){this._unsubscribe(e)},e.prototype.unsub=function(e){this.unsubscribe(e)},e.prototype.one=function(e){return this._one(e)},e.prototype.has=function(e){return this._has(e)},e.prototype.clear=function(){this._clear()},e}();t.DispatcherWrapper=l},210:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=t.EventListBase=t.DispatcherWrapper=t.DispatcherBase=void 0;var o=i(349);Object.defineProperty(t,"DispatcherBase",{enumerable:!0,get:function(){return o.DispatcherBase}}),Object.defineProperty(t,"DispatcherWrapper",{enumerable:!0,get:function(){return o.DispatcherWrapper}}),Object.defineProperty(t,"EventListBase",{enumerable:!0,get:function(){return o.EventListBase}});var n=i(422);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return n.Subscription}})},144:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManagement=void 0;var i=function(){function e(e){this.unsub=e,this.propagationStopped=!1}return e.prototype.stopPropagation=function(){this.propagationStopped=!0},e}();t.EventManagement=i},422:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=void 0;var i=function(){function e(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}return e.prototype.execute=function(e,t,i){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var o=this.handler;e?setTimeout((function(){o.apply(t,i)}),1):o.apply(t,i)}},e}();t.Subscription=i},685:function(e,t,i){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandlingBase=t.EventList=t.NonUniformEventList=t.EventDispatcher=void 0;var r=i(210),s=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype.dispatch=function(e,t){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(e,t){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(r.DispatcherBase);t.EventDispatcher=s;var a=function(){function e(){this._events={}}return e.prototype.get=function(e){if(this._events[e])return this._events[e];var t=this.createDispatcher();return this._events[e]=t,t},e.prototype.remove=function(e){delete this._events[e]},e.prototype.createDispatcher=function(){return new s},e}();t.NonUniformEventList=a;var l=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype.createDispatcher=function(){return new s},t}(r.EventListBase);t.EventList=l;var c=function(){function e(){this._events=new l}return Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e}();t.EventHandlingBase=c},132:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonUniformEventList=t.EventList=t.EventHandlingBase=t.EventDispatcher=void 0;var o=i(685);Object.defineProperty(t,"EventDispatcher",{enumerable:!0,get:function(){return o.EventDispatcher}}),Object.defineProperty(t,"EventHandlingBase",{enumerable:!0,get:function(){return o.EventHandlingBase}}),Object.defineProperty(t,"EventList",{enumerable:!0,get:function(){return o.EventList}}),Object.defineProperty(t,"NonUniformEventList",{enumerable:!0,get:function(){return o.NonUniformEventList}})},106:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalList=t.SignalHandlingBase=t.SignalDispatcher=void 0;var o=i(141);Object.defineProperty(t,"SignalDispatcher",{enumerable:!0,get:function(){return o.SignalDispatcher}}),Object.defineProperty(t,"SignalHandlingBase",{enumerable:!0,get:function(){return o.SignalHandlingBase}}),Object.defineProperty(t,"SignalList",{enumerable:!0,get:function(){return o.SignalList}})},141:function(e,t,i){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.SignalHandlingBase=t.SignalList=t.SignalDispatcher=void 0;var r=i(210),s=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype.dispatch=function(){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(r.DispatcherBase);t.SignalDispatcher=s;var a=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype.createDispatcher=function(){return new s},t}(r.EventListBase);t.SignalList=a;var l=function(){function e(){this._events=new a}return Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e}();t.SignalHandlingBase=l},602:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonUniformSimpleEventList=t.SimpleEventList=t.SimpleEventHandlingBase=t.SimpleEventDispatcher=void 0;var o=i(699);Object.defineProperty(t,"SimpleEventDispatcher",{enumerable:!0,get:function(){return o.SimpleEventDispatcher}}),Object.defineProperty(t,"SimpleEventHandlingBase",{enumerable:!0,get:function(){return o.SimpleEventHandlingBase}}),Object.defineProperty(t,"SimpleEventList",{enumerable:!0,get:function(){return o.SimpleEventList}}),Object.defineProperty(t,"NonUniformSimpleEventList",{enumerable:!0,get:function(){return o.NonUniformSimpleEventList}})},699:function(e,t,i){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},o(e,t)},function(e,t){function i(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleEventHandlingBase=t.SimpleEventList=t.NonUniformSimpleEventList=t.SimpleEventDispatcher=void 0;var r=i(210),s=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype.dispatch=function(e){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(e){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(r.DispatcherBase);t.SimpleEventDispatcher=s;var a=function(){function e(){this._events={}}return e.prototype.get=function(e){if(this._events[e])return this._events[e];var t=this.createDispatcher();return this._events[e]=t,t},e.prototype.remove=function(e){delete this._events[e]},e.prototype.createDispatcher=function(){return new s},e}();t.NonUniformSimpleEventList=a;var l=function(e){function t(){return e.call(this)||this}return n(t,e),t.prototype.createDispatcher=function(){return new s},t}(r.EventListBase);t.SimpleEventList=l;var c=function(){function e(){this._events=new l}return Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e}();t.SimpleEventHandlingBase=c},993:function(e,t,i){"use strict";var o=i(210);o.DispatcherBase,o.DispatcherWrapper,o.EventListBase,o.Subscription;var n=i(132);t.pB=n.EventDispatcher,n.EventHandlingBase,n.EventList,n.NonUniformEventList;var r=i(602);t.FK=r.SimpleEventDispatcher,r.SimpleEventHandlingBase,r.SimpleEventList,r.NonUniformSimpleEventList;var s=i(106);s.SignalDispatcher,s.SignalHandlingBase,s.SignalList},102:function(){var e=function(){function e(e,t){for(var i=0;io?i.right:o,r=i.bottom>r?i.bottom:r);return function(e,t,n,o){return e!==1/0&&t!==1/0&&n!==-1/0&&o!==-1/0}(t,n,o,r)?DOMRect.fromRect({x:t,y:n,width:o-t,height:r-n}):null}r.isUnsupportedPropertyName="IsUnsupportedProperty",r.mapsToDomPropertyName="MapsToDomProperty",r.codeBlockTypePropertyName="CodeBlockTypeProperty";class s{constructor(){this.isMouseCloserToBoundingClientRectLeftThanRight=(e,t)=>e<(2*t.left+t.width)/2}getBoundingClientRect(e){if(void 0!==e.getBoundingClientRect)return e.getBoundingClientRect();const t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect()}hasNonZeroArea(e){const t=this.getBoundingClientRect(e);return t&&t.width>0&&t.height>0}getBoundingRectForLogicalNode(e){const t=e.getDomNode();if(t)return this.getBoundingClientRect(t);return function(...e){const t=e.map((e=>{if(!e)return null;if(e.nodeType==Node.TEXT_NODE){const t=e;if(t.parentNode){const e=document.createRange();return e.selectNode(t),i(e.getClientRects())}return null}return e.nodeType==Node.ELEMENT_NODE?e.getBoundingClientRect():void 0}));return i(t)}(...this.getClosestAncestorDomNodes(e))}areCoordinatesInsideLogicalNode(e,t,n){const o=this.getBoundingRectForLogicalNode(n);return this.areCoordinatesInsideBoundingClientRect(e,t,o)}areCoordinatesInsideBoundingClientRect(e,t,n){const o=e>=n.left&&e<=n.right,r=t>=n.top&&t<=n.bottom;return o&&r}getClosestAncestorDomNodes(e){const t=[];if(!e)return t;const n=e.getDomNode();return n?(t.push(n),t):e.children?e.children.map((e=>this.getClosestAncestorDomNodes(e))).flat():t}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),this.init(t,n)}return p(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||y,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),o=1;o-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(r())return{};var s=o(i.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return r()?{}:{obj:e,k:o(i.shift())}}function E(e,t,n){var o=L(e,t,Object);o.obj[o.k]=n}function C(e,t){var n=L(e,t),o=n.obj,r=n.k;if(o)return o[r]}function I(e,t,n){var o=C(e,n);return void 0!==o?o:C(t,n)}function O(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):O(e[o],t[o],n):e[o]=t[o]);return e}function T(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return _[e]})):e}var D="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,A=function(e){function t(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return u(this,t),n=f(this,g(t).call(this)),D&&k.call(h(n)),n.data=e||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return m(t,e),p(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=[e,t];return n&&"string"!=typeof n&&(i=i.concat(n)),n&&"string"==typeof n&&(i=i.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(i=e.split(".")),C(this.data,i)}},{key:"addResource",value:function(e,t,n,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=t,t=(s=e.split("."))[1]),this.addNamespaces(t),E(this.data,s,o),r.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=C(this.data,s)||{};o?O(a,n,r):a=l({},a,n),E(this.data,s,a),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?l({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(k),j={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,r){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,o,r))})),t}},F={},M=function(e){function t(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(this,t),n=f(this,g(t).call(this)),D&&k.call(h(n)),x(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,h(n)),n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=w.create("translator"),n}return m(t,e),p(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:r};var s=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),e=s.join(o)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,n,o){var r=this;if("object"!==a(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],n),c=s.key,u=s.namespaces,d=u[u.length-1],p=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(h){var f=n.nsSeparator||this.options.nsSeparator;return d+f+c}return c}var g=this.resolve(e,n),v=g&&g.res,m=g&&g.usedKey||c,y=g&&g.exactUsedKey||c,b=Object.prototype.toString.apply(v),w=["[object Number]","[object Function]","[object RegExp]"],k=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,N="string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v;if(S&&v&&N&&w.indexOf(b)<0&&("string"!=typeof k||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,v,n):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(i){var x="[object Array]"===b,L=x?[]:{},E=x?y:m;for(var C in v)if(Object.prototype.hasOwnProperty.call(v,C)){var I="".concat(E).concat(i).concat(C);L[C]=this.translate(I,l({},n,{joinArrays:!1,ns:u})),L[C]===I&&(L[C]=v[C])}v=L}}else if(S&&"string"==typeof k&&"[object Array]"===b)(v=v.join(k))&&(v=this.extendTranslation(v,e,n,o));else{var O=!1,T=!1,_=void 0!==n.count&&"string"!=typeof n.count,P=t.hasDefaultValue(n),D=_?this.pluralResolver.getSuffix(p,n.count):"",A=n["defaultValue".concat(D)]||n.defaultValue;!this.isValidLookup(v)&&P&&(O=!0,v=A),this.isValidLookup(v)||(T=!0,v=c);var j=P&&A!==v&&this.options.updateMissing;if(T||O||j){if(this.logger.log(j?"updateKey":"missingKey",p,d,c,j?A:v),i){var F=this.resolve(c,l({},n,{keySeparator:!1}));F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var M=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var R=0;R1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var c=s.extractFromKey(e,a),l=c.key;n=l;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,p=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,h=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(i=e,!F["".concat(h[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(i)&&(F["".concat(h[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!s.isValidLookup(t)){r=n;var i,c,u=l,h=[u];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(h,l,n,e,a);else d&&(i=s.pluralResolver.getSuffix(n,a.count)),d&&p&&h.push(u+i),p&&h.push(u+="".concat(s.options.contextSeparator).concat(a.context)),d&&h.push(u+=i);for(;c=h.pop();)s.isValidLookup(t)||(o=c,t=s.getResource(n,e,c,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:o,usedLng:r,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),t}(k);function B(e){return e.charAt(0).toUpperCase()+e.slice(1)}var R=function(){function e(t){u(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=w.create("languageUtils")}return p(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=B(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=B(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=B(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var o=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(o))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e["default"]||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e["default"]),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=function(e){e&&(n.isSupportedCode(e)?r.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),o.forEach((function(e){r.indexOf(e)<0&&i(n.formatLanguageCode(e))})),r}}]),e}(),U=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],V={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function H(){var e={};return U.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:V[t.fc]}}))})),e}var W=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),this.languageUtils=t,this.options=n,this.logger=w.create("pluralResolver"),this.rules=H()}return p(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,o=this.getRule(e);if(o){var r=o.noAbs?o.plurals(t):o.plurals(Math.abs(t)),i=o.numbers[r];this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var s=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),z=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,e),this.logger=w.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return p(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:P,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?T(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?T(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?T(t.nestingPrefix):t.nestingPrefixEscaped||T("$t("),this.nestingSuffix=t.nestingSuffix?T(t.nestingSuffix):t.nestingSuffixEscaped||T(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var r,i,s,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var r=I(t,c,e);return a.alwaysFormat?a.format(r,void 0,n):r}var i=e.split(a.formatSeparator),s=i.shift().trim(),l=i.join(a.formatSeparator).trim();return a.format(I(t,c,s),l,n,o)};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?l(a.escape(e)):l(e)}}].forEach((function(t){for(s=0;r=t.regex.exec(e);){if(void 0===(i=u(r[1].trim())))if("function"==typeof d){var n=d(e,r,o);i="string"==typeof n?n:""}else{if(p){i=r[0];continue}a.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),i=""}else"string"==typeof i||a.useRawValueToEscape||(i=N(i));if(e=e.replace(r[0],t.safeValue(i)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,o,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=l({},i);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var o=e.split(new RegExp("".concat(n,"[ ]*{"))),r="{".concat(o[1]);e=o[0],r=(r=this.interpolate(r,s)).replace(/'/g,'"');try{s=JSON.parse(r),t&&(s=l({},t,s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(r)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],u=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var d=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=d.shift(),c=d,u=!0}if((o=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=N(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),u&&(o=c.reduce((function(e,t){return r.format(e,t,i.lng,i)}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();var K=function(e){function t(e,n,o){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return u(this,t),r=f(this,g(t).call(this)),D&&k.call(h(r)),r.backend=e,r.store=n,r.services=o,r.languageUtils=o.languageUtils,r.options=i,r.logger=w.create("backendConnector"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(o,i.backend,i),r}return m(t,e),p(t,[{key:"queueLoad",value:function(e,t,n,o){var r=this,i=[],s=[],a=[],c=[];return e.forEach((function(e){var o=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[a]=2:r.state[a]<0||(1===r.state[a]?s.indexOf(a)<0&&s.push(a):(r.state[a]=1,o=!1,s.indexOf(a)<0&&s.push(a),i.indexOf(a)<0&&i.push(a),c.indexOf(t)<0&&c.push(t)))})),o||a.push(e)})),(i.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:o}),{toLoad:i,pending:s,toLoadLanguages:a,toLoadNamespaces:c}}},{key:"loaded",value:function(e,t,n){var o=e.split("|"),r=o[0],i=o[1];t&&this.emit("failedLoading",r,i,t),n&&this.store.addResourceBundle(r,i,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){!function(e,t,n,o){var r=L(e,t,Object),i=r.obj,s=r.k;i[s]=i[s]||[],o&&(i[s]=i[s].concat(n)),o||i[s].push(n)}(n.loaded,[r],i),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var o=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,c){a&&c&&r<5?setTimeout((function(){o.read.call(o,e,t,n,r+1,2*i,s)}),i):s(a,c)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,o,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),r=o[0],i=o[1];this.read(r,i,"read",void 0,void 0,(function(o,s){o&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(r," failed"),o),!o&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(r),s),t.loaded(e,o,s)}))}},{key:"saveMissing",value:function(e,t,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,o,null,l({},i,{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,n,o))}}]),t}(k);function G(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===a(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===a(e[2])||"object"===a(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function $(){}var J=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(u(this,t),e=f(this,g(t).call(this)),D&&k.call(h(e)),e.options=q(n),e.services={},e.logger=w,e.modules={external:[]},o&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,o),f(e,h(e));setTimeout((function(){e.init(n,o)}),0)}return e}return m(t,e),p(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function o(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=l({},G(),this.options,q(t)),this.format=this.options.interpolation.format,n||(n=$),!this.options.isClone){this.modules.logger?w.init(o(this.modules.logger),this.options):w.init(null,this.options);var r=new R(this.options);this.store=new A(this.options.resources,this.options);var i=this.services;i.logger=w,i.resourceStore=this.store,i.languageUtils=r,i.pluralResolver=new W(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new z(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new K(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r1?n-1:0),r=1;r0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var a=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];a.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var u=S(),d=function(){var t=function(t,o){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(o),n(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),u}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$,o=n,r="string"==typeof e?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return o();var i=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(r)s(r);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(i,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,t,n){var o=S();return e||(e=this.languages),t||(t=this.options.ns),n||(n=$),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),n(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&j.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=S();this.emit("languageChanging",e);var r=function(e){var r="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);r&&(n.language||(n.language=r,n.languages=n.services.languageUtils.toResolveHierarchy(r)),n.translator.language||n.translator.changeLanguage(r),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(r)),n.loadResources(r,(function(e){!function(e,r){r?(n.language=r,n.languages=n.services.languageUtils.toResolveHierarchy(r),n.translator.changeLanguage(r),n.isLanguageChangingTo=void 0,n.emit("languageChanged",r),n.logger.log("languageChanged",r)):n.isLanguageChangingTo=void 0,o.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t){var n=this,o=function e(t,o){var r;if("object"!==a(o)){for(var i=arguments.length,s=new Array(i>2?i-2:0),c=2;c1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var s=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(o,e)||(!this.services.backendConnector.backend||!(!s(o,e)||r&&!s(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=S();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=S();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],r=e.filter((function(e){return o.indexOf(e)<0}));return r.length?(this.options.preload=o.concat(r),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(e,n)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$,r=l({},this.options,n,{isClone:!0}),i=new t(r),s=["store","services","language"];return s.forEach((function(t){i[t]=e[t]})),i.services=l({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new M(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0){var i=o.maxAge-0;if(isNaN(i))throw new Error("maxAge should be a Number");r+="; Max-Age="+Math.floor(i)}if(o.domain){if(!te.test(o.domain))throw new TypeError("option domain is invalid");r+="; Domain="+o.domain}if(o.path){if(!te.test(o.path))throw new TypeError("option path is invalid");r+="; Path="+o.path}if(o.expires){if("function"!=typeof o.expires.toUTCString)throw new TypeError("option expires is invalid");r+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(r+="; HttpOnly"),o.secure&&(r+="; Secure"),o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r},oe=function(e,t,n,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*n*1e3)),o&&(r.domain=o),document.cookie=ne(e,encodeURIComponent(t),r)},re=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=n.substring(1).split("&"),r=0;r0)o[r].substring(0,i)===e.lookupQuerystring&&(t=o[r].substring(i+1))}}return t}},ae=null,ce=function(){if(null!==ae)return ae;try{ae="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){ae=!1}return ae},le={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&ce()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&ce()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},ue=null,de=function(){if(null!==ue)return ue;try{ue="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){ue=!1}return ue},pe={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&de()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&de()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},he={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},fe={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},ge={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},ve={name:"subdomain",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);n instanceof Array&&(t="number"==typeof e.lookupFromSubdomainIndex?n[e.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n[0].replace("http://","").replace("https://","").replace(".",""))}return t}};var me=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return p(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=ee(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(ie),this.addDetector(se),this.addDetector(le),this.addDetector(pe),this.addDetector(he),this.addDetector(fe),this.addDetector(ge),this.addDetector(ve)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var o=t.detectors[e].lookup(t.options);o&&"string"==typeof o&&(o=[o]),o&&(n=n.concat(o))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();me.type="languageDetector";var ye=JSON.parse('{"translation":{"buttons":{"cancel":"Cancel","confirm":"Confirm"},"closeDialog":{"choice_pageSession":"On the next page load","choice_permanent":"Never","choice_visualStudioSession":"The next time I open Visual Studio","details":"When would you like to see Web Live Preview again?","header":"Confirm close?"},"menu":{"close":"Close","disableInspector":"Disable Inspector","enableInspector":"Enable Inspector","showEmptyElements":"Show Empty Elements","ariaLabel":"Web Live Preview"},"status":{"connectingToVisualStudio":"Connecting to Visual Studio...","generatingLogicalTree":"Generating Logical Tree...","updating":"Updating...","upToDate":"Up To Date","disconnectedShortMessage":"Disconnected","disconnectedFullMessage":"The browser has been disconnected from Visual Studio. Please refresh the browser to reconnect.","connectionTimeOut":"Connection timed out."},"simpleTextEditing":{"editableText_ariaLabel":"Text Editing Mode. Press ESC to escape."},"nodes":{"code":"Code","root":"Root"},"tagNavigator":{"leftScroller_ariaLabel":"Left Scroller","rightScroller_ariaLabel":"Right Scroller"},"selectorDecorator":{"elementOutline_ariaLabel":"Selected Element","actionPanel_ariaLabel":"Action Panel Indicator"},"menuButton":{"image_ariaLabel":"Web Live Preview Menu"},"logicalNodeShortNames":{"genericContainer":"Generic Container","root":"Root","unknown":"Unknown"},"actionPanel":{"title":"{{nodeName}} Tasks","_title.comment":"nodeName is the ID or tag name of the node for which the action panel is being displayed.","readOnlyProperty":"This property is read-only"},"screenReader":{"inspectorEnabled":"Inspector enabled.","inspectorDisabled":"Inspector disabled."}}}');var be=function(){this.__data__=[],this.size=0};var we=function(e,t){return e===t||e!=e&&t!=t};var ke=function(e,t){for(var n=e.length;n--;)if(we(e[n][0],t))return n;return-1},Se=Array.prototype.splice;var Ne=function(e){var t=this.__data__,n=ke(t,e);return!(n<0)&&(n==t.length-1?t.pop():Se.call(t,n,1),--this.size,!0)};var xe=function(e){var t=this.__data__,n=ke(t,e);return n<0?void 0:t[n][1]};var Le=function(e){return ke(this.__data__,e)>-1};var Ee=function(e,t){var n=this.__data__,o=ke(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};function Ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=pn},fn={};fn["[object Float32Array]"]=fn["[object Float64Array]"]=fn["[object Int8Array]"]=fn["[object Int16Array]"]=fn["[object Int32Array]"]=fn["[object Uint8Array]"]=fn["[object Uint8ClampedArray]"]=fn["[object Uint16Array]"]=fn["[object Uint32Array]"]=!0,fn["[object Arguments]"]=fn["[object Array]"]=fn["[object ArrayBuffer]"]=fn["[object Boolean]"]=fn["[object DataView]"]=fn["[object Date]"]=fn["[object Error]"]=fn["[object Function]"]=fn["[object Map]"]=fn["[object Number]"]=fn["[object Object]"]=fn["[object RegExp]"]=fn["[object Set]"]=fn["[object String]"]=fn["[object WeakMap]"]=!1;var gn=function(e){return $t(e)&&hn(e.length)&&!!fn[qe(e)]};var vn=function(e){return function(t){return e(t)}},mn="object"==typeof exports&&exports&&!exports.nodeType&&exports,yn=mn&&"object"==typeof module&&module&&!module.nodeType&&module,bn=yn&&yn.exports===mn&&De.process,wn=function(){try{var e=yn&&yn.require&&yn.require("util").types;return e||bn&&bn.binding&&bn.binding("util")}catch(e){}}(),kn=wn&&wn.isTypedArray,Sn=kn?vn(kn):gn,Nn=Object.prototype.hasOwnProperty;var xn=function(e,t){var n=nn(e),o=!n&&tn(e),r=!n&&!o&&cn(e),i=!n&&!o&&!r&&Sn(e),s=n||o||r||i,a=s?qt(e.length,String):[],c=a.length;for(var l in e)!t&&!Nn.call(e,l)||s&&("length"==l||r&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||dn(l,c))||a.push(l);return a},Ln=Object.prototype;var En=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ln)};var Cn=function(e,t){return function(n){return e(t(n))}},In=Cn(Object.keys,Object),On=Object.prototype.hasOwnProperty;var Tn=function(e){if(!En(e))return In(e);var t=[];for(var n in Object(e))On.call(e,n)&&"constructor"!=n&&t.push(n);return t};var _n=function(e){return null!=e&&hn(e.length)&&!et(e)};var Pn=function(e){return _n(e)?xn(e):Tn(e)};var Dn=function(e,t){return e&&Gt(t,Pn(t),e)};var An=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},jn=Object.prototype.hasOwnProperty;var Fn=function(e){if(!$e(e))return An(e);var t=En(e),n=[];for(var o in e)("constructor"!=o||!t&&jn.call(e,o))&&n.push(o);return n};var Mn=function(e){return _n(e)?xn(e,!0):Fn(e)};var Bn=function(e,t){return e&&Gt(t,Mn(t),e)},Rn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Un=Rn&&"object"==typeof module&&module&&!module.nodeType&&module,Vn=Un&&Un.exports===Rn?je.Buffer:void 0,Hn=Vn?Vn.allocUnsafe:void 0;var Wn=function(e,t){if(t)return e.slice();var n=e.length,o=Hn?Hn(n):new e.constructor(n);return e.copy(o),o};var zn=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n{const o=n[0],r=n[1];"string"==typeof r||r instanceof String?t[o]=r.split("").reverse().join(""):e(r)}))}(kr);const Sr={en:ye,dev:kr};function Nr(e,t){return X.t(e,t)}function xr(e){return!(!e||!e.start)&&(!function(e){return!!(e&&e.start&&e.start.path)&&(!(!e.start.path.startsWith("preview_")&&!e.start.path.startsWith("rendered_"))||void 0)}(e)&&("Attribute"!==e.type&&("Text"!==e.type||e.text&&""!==e.text.trim())))}X.use(me),X.init({resources:Sr,fallbackLng:"en",detection:{excludeCacheFor:["cimode","dev"]}});new s;class Lr{constructor(e,t){this.requiredAncestorForSelectability="body",this.nodeBoundingClientRectUtil=e||new s,this._browserLink=t}findValidInsertionPoint(e,t,n){var o;if(!e)throw Error("parentNode must not be null or undefined.");const r=this.getParentsUntilDefault(e);if(!r.modifiedParentNode)throw Error("No default ancestor found.");null!==(o=n)&&void 0!==o||(n=[]);const i=this.findFirstDefaultPreviousSibling(t,r,n);return new Er(r.modifiedParentNode,i)}findLeftMostSelectableLeaf(e){return e?this.findLeftMostSelectableLeafInternal(e,!1):null}getParentsUntilDefault(e){if(!e)throw Error("firstParent must not be null or undefined.");const t=new Cr;for(t.push(e);t.modifiedParentNode&&!o(t.modifiedParentNode).mapsToDom;)t.push(t.modifiedParentNode.parent);return t}findFirstDefaultPreviousSibling(e,t,n){for(let o=e?0:1;o=0;i--){const n=e.children[i];if(o(n).mapsToDom&&!t.includes(n))return n;const r=this.findRightMostDefaultDescendant(n,t);if(r)return r}return null}findLeftMostSelectableLeafInternal(e,t){if(t=t||this.isBodyTag(e),e.children)for(const n of e.children){const e=this.findLeftMostSelectableLeafInternal(n,t);if(e)return e}return t&&this.isInitiallySelectable(e)?e:null}isBodyTag(e){var t;return(null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase())===this.requiredAncestorForSelectability}isInitiallySelectable(e){return!(this._browserLink&&!function(e,t){var n;const o=null===(n=e.statusService)||void 0===n?void 0:n.targetFilePath;return!o||o==t.start.path}(this._browserLink,e))&&(xr(e)&&0===e.children.length&&e.getDomNode()&&this.nodeBoundingClientRectUtil.hasNonZeroArea(e.getDomNode()))}}class Er{constructor(e=null,t=null){this.modifiedParentNode=e,this.modifiedInsertAfterLogicalNode=t}}class Cr{constructor(){this.parentNodeList=[]}get modifiedParentNode(){return 0===this.parentNodeList.length?null:this.parentNodeList[this.parentNodeList.length-1]}push(e){this.parentNodeList.push(e)}}class Ir extends Error{constructor(e,t){super(e),this.name=this.constructor.name,this.change=t}}class Or extends Ir{constructor(e){super("Validation failed for this change.",e)}}class Tr{static isNullOrUndefined(e){return null==e}static validateUpdatePositionChange(e){if(!(e&&e.nodeId&&e.startPosition>=0&&e.length>=0))throw new Or(e)}static validateSetNodeIdChange(e){if(!(e&&e.newNodeId&&e.sourcePath&&e.startPosition>=0&&e.length>=1&&e.type))throw new Or(e)}static validateInsertCodeBlockChange(e){if(!(e&&e.codeBlockType&&e.parentNodeId&&e.newNodeId&&e.sourcePath&&e.startPosition>=0&&e.length>0))throw new Or(e)}static validateInsertGenericContainerChange(e){if(!(e&&e.parentNodeId&&e.newNodeId&&e.sourcePath&&e.startPosition>=0&&e.length>0))throw new Or(e)}static validateInsertElementChange(e){if(!(e&&e.tagName&&e.parentNodeId&&e.newNodeId&&e.sourcePath&&e.startPosition>=0&&e.length>0))throw new Or(e)}static validateInsertAttributeChange(e){if(!(e&&e.parentNodeId&&e.attributeName&&e.sourcePath&&e.startPosition>=0&&e.length>0))throw new Or(e)}static validateInsertTextChange(e){if(!(e&&e.parentNodeId&&e.text&&e.sourcePath&&e.startPosition>=0&&e.length>0))throw new Or(e)}static validateModifyElementChange(e){if(!e||!e.nodeId||this.isNullOrUndefined(e.tagName))throw new Or(e)}static validateModifyAttributeChange(e){if(!e||!e.nodeId||this.isNullOrUndefined(e.oldAttributeValue)||this.isNullOrUndefined(e.newAttributeValue))throw new Or(e)}static validateModifyTextChange(e){if(!e||!e.nodeId||this.isNullOrUndefined(e.oldText)||this.isNullOrUndefined(e.newText))throw new Or(e)}static validateRemoveElementTreeChange(e){if(!e||!e.nodeId)throw new Or(e)}static validateUnwrapElementsChange(e){if(!e||!e.nodeId)throw new Or(e)}static validateRemoveAttributeChange(e){if(!e||!e.nodeId)throw new Or(e)}static validateRemoveTextChange(e){if(!e||!e.nodeId)throw new Or(e)}static validateMoveElementChange(e){if(!e||!e.nodeId||!e.parentNodeId)throw new Or(e)}static validateMoveTextChange(e){if(!e||!e.nodeId||!e.parentNodeId)throw new Or(e)}}var _r,Pr=n(993);class Dr{constructor(){this.successes=new Ar,this.failures=new Ar}addResult(e,t){switch(t){case"InsertElement":e.InsertElement++;break;case"ModifyElement":e.ModifyElement++;break;case"RemoveElementTree":e.RemoveElementTree++;break;case"UnwrapElements":e.UnwrapElements++;break;case"MoveElement":e.MoveElement++;break;case"InsertText":e.InsertText++;break;case"ModifyText":e.ModifyText++;break;case"RemoveText":e.RemoveText++;break;case"InsertAttribute":e.InsertAttribute++;break;case"ModifyAttribute":e.ModifyAttribute++;break;case"RemoveAttribute":e.RemoveAttribute++;break;case"MoveAttribute":e.MoveAttribute++;break;case"InsertCodeBlock":e.InsertCodeBlock++;break;case"InsertGenericContainer":e.InsertGenericContainer++;break;case"SetNodeId":e.SetNodeId++;break;case"UpdatePositions":e.UpdatePositions++}}addSuccess(e){this.addResult(this.successes,e)}addFailure(e){this.addResult(this.failures,e)}}class Ar{constructor(){this.InsertElement=0,this.ModifyElement=0,this.RemoveElementTree=0,this.UnwrapElements=0,this.MoveElement=0,this.InsertText=0,this.ModifyText=0,this.RemoveText=0,this.InsertAttribute=0,this.ModifyAttribute=0,this.RemoveAttribute=0,this.MoveAttribute=0,this.InsertCodeBlock=0,this.InsertGenericContainer=0,this.SetNodeId=0,this.UpdatePositions=0}}class jr{constructor(){this.inserted=[],this.removed=[]}}class Fr{constructor(e,t){this.applyChangesFunctions={},this.idMapping={},this.logicalTreeTraverser=new Lr,this.areHtmlFilesTracked=!1,this.changeErrorCount=0,this._changesApplied=new Pr.FK,this.logNoisyChanges=!1,this.documentWrapper=t,this.browserLink=e,this.textModificationElement=this.documentWrapper.createElement("textarea"),this.applyChangesFunctions["InsertElement"]=(e,t)=>this.insertElement(e,t),this.applyChangesFunctions["RemoveElementTree"]=(e,t)=>this.removeElementTree(e,t),this.applyChangesFunctions["MoveElement"]=(e,t)=>this.moveElement(t),this.applyChangesFunctions["InsertAttribute"]=(e,t)=>this.insertAttribute(e,t),this.applyChangesFunctions["RemoveAttribute"]=(e,t)=>this.removeAttribute(e,t),this.applyChangesFunctions["ModifyAttribute"]=(e,t)=>this.modifyAttribute(t),this.applyChangesFunctions["MoveAttribute"]=(e,t)=>this.moveAttribute(t),this.applyChangesFunctions["ModifyElement"]=(e,t)=>this.modifyElement(t),this.applyChangesFunctions["ModifyText"]=(e,t)=>this.modifyText(t),this.applyChangesFunctions["InsertText"]=(e,t)=>this.insertText(e,t),this.applyChangesFunctions["RemoveText"]=(e,t)=>this.removeText(e,t),this.applyChangesFunctions["MoveText"]=(e,t)=>this.moveText(t),this.applyChangesFunctions["SplitElement"]=(e,t)=>this.noOp(),this.applyChangesFunctions["MergeElements"]=(e,t)=>this.noOp(),this.applyChangesFunctions["WrapElements"]=(e,t)=>this.noOp(),this.applyChangesFunctions["UnwrapElements"]=(e,t)=>this.unwrapElements(e,t),this.applyChangesFunctions["SetNodeId"]=(e,t)=>this.setNodeId(t),this.applyChangesFunctions["UpdatePositions"]=(e,t)=>this.updatePositions(t),this.applyChangesFunctions["InsertCodeBlock"]=(e,t)=>this.insertCodeBlock(e,t),this.applyChangesFunctions["InsertGenericContainer"]=(e,t)=>this.insertGenericContainer(e,t),this.applyChangesFunctions["AutoSyncChangeProcessStartTime"]=(e,t)=>this.noOp(),this.applyChangesFunctions["UpdateSourcePath"]=(e,t)=>this.updateSourcePath(t),this.applyChangesFunctions["Unsupported"]=(e,t)=>this.noOp()}get changesApplied(){return this._changesApplied.asEvent()}get hasChangeError(){return this.changeErrorCount>0}initialize(){this.browserLink.designSurfaceService.isEnabled?this.ensureHtmlFilesAreTracked():this.browserLink.designSurfaceService.isEnabledChanged.one(this.onIsDesignSurfaceEnabledChanged.bind(this))}onIsDesignSurfaceEnabledChanged(){this.ensureHtmlFilesAreTracked()}ensureHtmlFilesAreTracked(){this.areHtmlFilesTracked||(this.areHtmlFilesTracked=!0,this.browserLink.sourceMapping.ensureUpToDateAsync((()=>{this.browserLink.invoke("TrackDocumentsForHtmlAutoSync",this.browserLink.sourceMapping.getAllSourcePaths())})))}shouldLogChange(e){return this.logNoisyChanges||"SetNodeId"!==e&&"UpdatePositions"!==e}logChange(e){this.shouldLogChange(e.type)&&this.browserLink.log("Applying change: %o",e)}getLogicalNodesFromNodeId(e){return this.idMapping[e]||[]}mapIdToLogicalNode(e,t){this.idMapping[e]||(this.idMapping[e]=[]);-1===this.idMapping[e].indexOf(t)&&(this.idMapping[e].push(t),t.nodeId=e)}clearIdMappingForId(e){this.idMapping[e]=[]}removeNodeAndDescendantsFromIdMapping(e){if(this.removeNodeFromIdMapping(e),e.children)for(const t of e.children)this.removeNodeAndDescendantsFromIdMapping(t);if(e.attributes)for(const t of e.attributes)this.removeNodeFromIdMapping(t)}removeNodeFromIdMapping(e){const t=this.idMapping[e.nodeId];if(t){const n=t.indexOf(e);n>=0&&t.splice(n,1)}}createLogicalNode(e,t,n,o,r,i){const s=this.browserLink.logicalTree.createNewLogicalNode(t,n,r,i);return this.mapIdToLogicalNode(e,s),s.start.path=o,s}forEachLogicalNodeWithId(e,t,n){const o=this.getLogicalNodesFromNodeId(e).slice();if(0===o.length)throw new Ir("No logical node found.",t);for(const e of o)n(t,e)}sortLogicalNodesBasedOnDomTextOrder(e,t){return e.sort(((e,n)=>t.indexOf(this.fixTextForDomComparison(e.text))-t.indexOf(this.fixTextForDomComparison(n.text))))}breakUpDomTextNode(e,t){const n=t,o=n.textContent,r=this.browserLink.logicalTree.getLogicalNodesFromDomNode(n);if(r.length>1){const t=this.sortLogicalNodesBasedOnDomTextOrder(r,o);if(e!==t[t.length-1]){const o=t.indexOf(e);let r=0;for(let e=0;e<=o;e++)r+=this.fixTextForDomComparison(t[e].text).length;const i=n.splitText(r);for(let e=0;e=0&&(e.splice(n,1),!0)}findPreviousSibling(e){if(!e||!e.parent||!e.parent.children)return null;const t=e.parent.children.indexOf(e);return 0===t?null:e.parent.children[t-1]}fixTextForDomComparison(e){return this.textModificationElement.innerHTML=e,this.textModificationElement.innerHTML}handleApplyChangeError(e){this.browserLink.log("Failed to apply change %o with error %o",e.change,e),this.changeErrorCount++}handleUnknownChange(e){this.browserLink.log("Unknown change type in %o",e),this.changeErrorCount++}applyHtmlChanges(e){try{return this.browserLink.log("Got changes: %o",e),this.applyChanges(e),!0}catch(e){return this.browserLink.log("Failed to apply HTML changes: %o",e),!1}}applyChanges(e){if(!e)return void this.browserLink.log("No changes to apply.");const t=new jr,n=new Dr;let o;for(let r=0;rthis.insertCodeBlockInternal(e,t,n.parent,n))):this.forEachLogicalNodeWithId(t.parentNodeId,t,((t,n)=>this.insertCodeBlockInternal(e,t,n,null)))}insertCodeBlockInternal(e,t,n,r){const i=this.createLogicalNode(t.newNodeId,_r.CodeBlock,null,t.sourcePath,n,r);i.start.position=t.startPosition,i.length=t.length;const s=o(i);s.mapsToDom=!1,s.codeBlockType=t.codeBlockType,e.inserted.push(i)}insertGenericContainer(e,t){Tr.validateInsertGenericContainerChange(t),t.insertAfterNodeId?this.forEachLogicalNodeWithId(t.insertAfterNodeId,t,((t,n)=>this.insertGenericContainerInternal(e,t,n.parent,n))):this.forEachLogicalNodeWithId(t.parentNodeId,t,((t,n)=>this.insertGenericContainerInternal(e,t,n,null)))}insertGenericContainerInternal(e,t,n,r){const i=this.createLogicalNode(t.newNodeId,_r.GenericContainer,null,t.sourcePath,n,r);i.description=t.description,i.start.position=t.startPosition,i.length=t.length,o(i).mapsToDom=!1,e.inserted.push(i)}insertElement(e,t){Tr.validateInsertElementChange(t),t.insertAfterNodeId?this.forEachLogicalNodeWithId(t.insertAfterNodeId,t,((t,n)=>this.insertElementInternal(e,t,t.tagName,n.parent,n))):this.forEachLogicalNodeWithId(t.parentNodeId,t,((t,n)=>this.insertElementInternal(e,t,t.tagName,n,null)))}insertElementInternal(e,t,n,r,i){let s=null;if(t.mapsToDom){const e=this.logicalTreeTraverser.findValidInsertionPoint(r,i);if(!e||!e.modifiedParentNode)throw new Ir("Failed to find logical tree insertion point.",t);const o=e.modifiedParentNode.getDomNode(),a=e.modifiedInsertAfterLogicalNode?e.modifiedInsertAfterLogicalNode.getDomNode():null;if(!o||e.modifiedInsertAfterLogicalNode&&!a)throw new Ir("Failed to find DOM insertion point.",t);a&&a.nodeType===Node.TEXT_NODE&&this.breakUpDomTextNode(e.modifiedInsertAfterLogicalNode,a),s=document.createElement(n),e.modifiedInsertAfterLogicalNode?Mr(s,a):Br(s,o)}const a=this.createLogicalNode(t.newNodeId,_r.Element,s,t.sourcePath,r,i);a.tagName=t.tagName,a.start.position=t.startPosition,a.length=t.length,o(a).mapsToDom=t.mapsToDom,e.inserted.push(a)}insertAttribute(e,t){Tr.validateInsertAttributeChange(t);const n=this.getLogicalNodesFromNodeId(t.parentNodeId);if(0===n.length)throw new Ir("Failed to find parent for new attribute.",t);for(const o of n)this.insertAttributeInParent(e,t,o)}insertAttributeInParent(e,t,n){if(!n)throw new Ir("Invalid parent for attribute.",t);let r=null;const i=o(n).mapsToDom;if(t.mapsToDom!==i)throw new Ir("If the new attribute maps to the DOM, the parent must as well.",t);if(i){const e=n?n.getDomNode():null;if(!e)throw new Ir("Failed to find parent DOM element.",t);e.setAttribute(t.attributeName,t.attributeValue);r=e.getAttributeNode(t.attributeName)}const s=this.createLogicalNode(t.newNodeId,_r.Attribute,r,t.sourcePath,n,null);s.name=t.attributeName,s.value=t.attributeValue,s.start.position=t.startPosition,s.length=t.length,o(s).mapsToDom=t.mapsToDom,e.inserted.push(s)}insertText(e,t){Tr.validateInsertTextChange(t),t.insertAfterNodeId?this.forEachLogicalNodeWithId(t.insertAfterNodeId,t,((t,n)=>this.insertTextInternal(e,t,n.parent,n))):this.forEachLogicalNodeWithId(t.parentNodeId,t,((t,n)=>this.insertTextInternal(e,t,n,null)))}insertTextInternal(e,t,n,r){let i=null;if(t.mapsToDom){const e=this.logicalTreeTraverser.findValidInsertionPoint(n,r);if(!e||!e.modifiedParentNode)throw new Ir("Failed to find logical tree insertion point.",t);const o=e.modifiedParentNode.getDomNode(),s=e.modifiedInsertAfterLogicalNode?e.modifiedInsertAfterLogicalNode.getDomNode():null;if(!o||e.modifiedInsertAfterLogicalNode&&!s)throw new Ir("Failed to find DOM insertion point.",t);s&&s.nodeType===Node.TEXT_NODE&&this.breakUpDomTextNode(e.modifiedInsertAfterLogicalNode,s),i=document.createTextNode(t.text),e.modifiedInsertAfterLogicalNode?Mr(i,s):Br(i,o)}const s=this.createLogicalNode(t.newNodeId,_r.Text,i,t.sourcePath,n,r);s.start.position=t.startPosition,s.length=t.length,s.text=t.text,o(s).mapsToDom=t.mapsToDom,e.inserted.push(s)}modifyElement(e){Tr.validateModifyElementChange(e),this.forEachLogicalNodeWithId(e.nodeId,e,((e,t)=>this.modifyElementByNode(e,t)))}modifyElementByNode(e,t){if(t.tagName=e.tagName,o(t).mapsToDom){const n=t.getDomNode(),o=n.parentElement;if(!n||!o)throw new Ir("Failed to find DOM element to modify or its parent.",e);const r=this.documentWrapper.createElement(e.tagName);for(;n.firstChild;){const e=n.firstChild;n.removeChild(e),r.appendChild(e)}for(let e=0;ethis.modifyAttributeByNode(e,t)))}modifyAttributeByNode(e,t){if(t.value=e.newAttributeValue,o(t).mapsToDom){const n=t.getDomNode();if(!n)throw new Ir("Failed to find DOM attribute to modify",e);if(n.value!==e.oldAttributeValue)throw new Ir("Existing attribute value does not match previous value.",e);n.value=e.newAttributeValue}}modifyText(e){Tr.validateModifyTextChange(e),this.forEachLogicalNodeWithId(e.nodeId,e,((e,t)=>this.modifyTextByNode(e,t)))}modifyTextByNode(e,t){if(t.text=e.newText,o(t).mapsToDom){const n=t.getDomNode();if(!n)throw new Ir("Failed to find DOM text to modify",e);const o=this.browserLink.logicalTree.getLogicalNodesFromDomNode(n);if(!o||0==o.length||-1==o.indexOf(t))throw new Ir("Failed to find related logical nodes for DOM node being modified.",e);let r="",i="";for(const n of o)n===t?(r+=e.oldText,i+=e.newText):n.text&&(r+=n.text,i+=n.text);if(r=this.fixTextForDomComparison(r),i=this.fixTextForDomComparison(i),n.textContent!==r){if(n.textContent===i)return;throw new Ir("Existing text does not match previous value.",e)}n.textContent=i}}removeElementTree(e,t){Tr.validateRemoveElementTreeChange(t),this.forEachLogicalNodeWithId(t.nodeId,t,((t,n)=>this.removeElementTreeByNode(e,t,n)))}removeElementTreeByNode(e,t,n){const o=n.parent;if(!o)throw new Ir("Failed to find parent logical node.",t);this.removeDescendantDomNodesIncludingSelf(n),this.removeLogicalNodeAndDescendants(e,o.children,n)}removeLogicalNodeAndDescendants(e,t,n){this.removeLogicalNode(t,n),this.trackTreeRemoval(e,n),this.removeNodeAndDescendantsFromIdMapping(n)}trackTreeRemoval(e,t){if(e.removed.push(t),t.attributes)for(const n of t.attributes)this.trackTreeRemoval(e,n);if(t.children)for(const n of t.children)this.trackTreeRemoval(e,n)}removeDescendantDomNodesIncludingSelf(e){if(o(e).mapsToDom){const n=e.getDomNode();n&&null!=(t=n)&&t.parentNode&&t.parentNode.removeChild(t)}else for(const t of e.children)this.removeDescendantDomNodesIncludingSelf(t);var t}unwrapElements(e,t){Tr.validateUnwrapElementsChange(t),this.forEachLogicalNodeWithId(t.nodeId,t,((t,n)=>this.unwrapElementsByNode(e,t,n))),this.clearIdMappingForId(t.nodeId)}unwrapElementsByNode(e,t,n){const r=n.parent;if(!r)throw new Ir("Failed to find parent logical node.",t);if(o(n).mapsToDom){const e=n.getDomNode(),o=this.logicalTreeTraverser.findValidInsertionPoint(r,this.findPreviousSibling(r));if(!o||!o.modifiedParentNode)throw new Ir("Failed to find logical tree insertion point.",t);const i=o.modifiedParentNode.getDomNode();if(!i)throw new Ir("Failed to find parent DOM element.",t);for(;e.firstChild;){const t=e.firstChild;e.removeChild(t),i.insertBefore(t,e)}i.removeChild(e)}for(;n.children.length>0;){const e=n.children[n.children.length-1];this.removeLogicalNode(n.children,e),e.parent=r,this.insertLogicalNodeAfter(r.children,e,n)}this.removeLogicalNode(r.children,n),e.removed.push(n)}removeAttribute(e,t){Tr.validateRemoveAttributeChange(t),this.forEachLogicalNodeWithId(t.nodeId,t,((t,n)=>this.removeAttributeFromElement(e,t,n))),this.clearIdMappingForId(t.nodeId)}removeAttributeFromElement(e,t,n){const r=n.parent;if(!r)throw new Ir("Failed to find parent logical node.",t);if(o(n).mapsToDom&&o(r).mapsToDom){const e=n.getDomNode();if(!e)throw new Ir("Failed to find DOM attribute node to remove.",t);const o=e.ownerElement;if(!o)throw new Ir("Failed to find DOM attribute node's parent element.",t);o.removeAttribute(e.name)}this.removeLogicalNode(r.attributes,n),e.removed.push(n)}removeText(e,t){Tr.validateRemoveTextChange(t),this.forEachLogicalNodeWithId(t.nodeId,t,((t,n)=>this.removeTextByNode(e,t,n))),this.clearIdMappingForId(t.nodeId)}removeTextByNode(e,t,n){const r=n.parent;if(!r)throw new Ir("Failed to find parent logical node.",t);if(o(n).mapsToDom){const e=n.getDomNode();if(!e)throw new Ir("Failed to find DOM text node to remove.",t);const o=e.parentElement;if(!o)throw new Ir("Failed to find DOM text node's parent element.",t);o.removeChild(e)}this.removeLogicalNode(r.children,n),e.removed.push(n)}moveElement(e){Tr.validateMoveElementChange(e),this.moveNode(e,e.nodeId,e.parentNodeId,e.insertAfterNodeId)}moveText(e){Tr.validateMoveTextChange(e),this.moveNode(e,e.nodeId,e.parentNodeId,e.insertAfterNodeId)}moveNode(e,t,n,r){const i=this.getLogicalNodesFromNodeId(t),s=this.getLogicalNodesFromNodeId(n),a=r?this.getLogicalNodesFromNodeId(r):[];if(1!==i.length||1!==s.length||a.length>1)throw new Ir("Moving nodes with multiple logical nodes, multiple parents or multiple insert after nodes is not supported.",e);const c=i[0],l=c.parent,u=s[0],d=a.length>0?a[0]:null;if(!l)throw new Ir("Failed to find parent logical node.",e);if(o(c).mapsToDom){const t=c.getDomNode();if(!t)throw new Ir("Failed to find DOM node to move.",e);const n=this.logicalTreeTraverser.findValidInsertionPoint(u,d,[c]);if(!n||!n.modifiedParentNode)throw new Ir("Failed to find logical tree insertion point.",e);const o=t.parentNode,r=n.modifiedParentNode.getDomNode(),i=n.modifiedInsertAfterLogicalNode?n.modifiedInsertAfterLogicalNode.getDomNode():null;if(!o||!r)throw new Ir("Failed to find parent DOM element or new parent DOM element.",e);i&&i.nodeType===Node.TEXT_NODE&&this.breakUpDomTextNode(n.modifiedInsertAfterLogicalNode,i),t&&o&&r&&(o.removeChild(t),i?Mr(t,i):Br(t,r))}d?this.insertLogicalNodeAfter(u.children,c,d):this.insertLogicalNodeAtBeginning(u.children,c),c.parent=u,this.removeLogicalNode(l.children,c)}moveAttribute(e){const t=this.getLogicalNodesFromNodeId(e.nodeId),n=this.getLogicalNodesFromNodeId(e.parentNodeId);if(1!==t.length||1!==n.length)throw new Ir("Moving nodes with multiple logical nodes, multiple parents or multiple insert after nodes is not supported.",e);const r=t[0],i=r.parent,s=n[0];if(!i)throw new Ir("Failed to find parent logical node.",e);if(o(r).mapsToDom){const t=r.getDomNode();if(!t)throw new Ir("Failed to find DOM node to move.",e);const n=i.getDomNode(),o=s.getDomNode();if(!n||!o)throw new Ir("Failed to find parent DOM element or new parent DOM element.",e);n.removeAttributeNode(t),o.setAttributeNode(t)}this.removeLogicalNode(i.attributes,r),r.parent=s,s.attributes.push(r)}updateSourcePath(e){this.updateSourcePathInternal(this.browserLink.logicalTree.root,e)}updateSourcePathInternal(e,t){if(e.start.path===t.originalSourcePath&&(e.start.path=t.newSourcePath),e.children)for(const n of e.children)this.updateSourcePathInternal(n,t);if(e.attributes)for(const n of e.attributes)this.updateSourcePathInternal(n,t)}}function Mr(e,t){e&&null!=t&&t.parentNode&&t.parentNode.insertBefore(e,t.nextSibling)}function Br(e,t){e&&t&&t.insertBefore(e,t.firstChild)}!function(e){e["Root"]="Root",e["Element"]="Element",e["Attribute"]="Attribute",e["Comment"]="Comment",e["Text"]="Text",e["CodeBlock"]="CodeBlock",e["GenericContainer"]="GenericContainer"}(_r||(_r={}));class Rr{constructor(e){this.browserLink=e}dragAndDropAfterSiblingNode(e,t){this.browserLink.invoke("DropControlTextInEditor",e.start.path,e.start.position,1,t)}moveNodeAfterSiblingNode(e,t){this.browserLink.invoke("MoveNodeInEditor",e.start.path,e.start.position+e.length,t.start.position,t.start.position+t.length)}moveNodeAsFirstChild(e,t){this.browserLink.invoke("MoveNodeInEditor",e.start.path,e.start.position+e.startTagLength,t.start.position,t.start.position+t.length)}insertTextAfterSiblingNode(e,t){this.browserLink.invoke("InsertTextInEditor",e.start.path,e.start.position,1,t)}dragAndDropAsFirstChild(e,t){this.browserLink.invoke("DropControlTextInEditor",e.start.path,e.start.position,4,t)}insertTextAsFirstChild(e,t){this.browserLink.invoke("InsertTextInEditor",e.start.path,e.start.position,4,t)}replaceTextInTextNode(e,t){this.browserLink.invoke("ReplaceTextInEditor",e.start.path,e.start.position,e.text.length,t)}}class Ur{constructor(e){this.browserLink=e}refreshAllBrowsers(){this.browserLink.invoke("RefreshBrowsers")}}function Vr(e){return"function"==typeof e["then"]&&"function"==typeof e["catch"]&&"function"==typeof e["finally"]?e:new Promise((t=>e.continueWith(t)))}class Hr{constructor(e){this.browserLink=e}getCurrentUpdateFullStatus(){return Vr(this.browserLink.invokeAsync("GetCurrentUpdateState"))}getCurrentUpdateShortStatus(){return Vr(this.browserLink.invokeAsync("GetCurrentUpdateStateShortMsg"))}getCurrentMessageType(){return Vr(this.browserLink.invokeAsync("GetCurrentMessageType"))}}class Wr{constructor(e){var t;this.browserLink=e,this.handleIsInitializedChanged=(e,t)=>{t&&this.sendInitializationSucceeded()},null==e||null===(t=e.logicalTreeInitializedStatusService)||void 0===t||t.isInitializedChanged.subscribe(this.handleIsInitializedChanged)}sendInitializationSucceeded(){var e,t;if(this.initializationSucceededTelemetryFired||null===(e=this.browserLink)||void 0===e||null===(t=e.wlpInitStartInfoService)||void 0===t||!t.startTime)return;this.initializationSucceededTelemetryFired=!0;const n=(new Date).getTime(),o=this.browserLink.wlpInitStartInfoService.startTime.getTime();this.browserLink.invokeAsync("SendWlpSuccessfulInitTimeTelemetryEvent",o,n)}sendChangesApplied(e,t){let n=-1;if(t){const e=new Date,o=new Date(Date.parse(t));n=e.getTime()-o.getTime()}this.browserLink.invokeAsync("SendChangesAppliedTelemetryEvent",e,n)}sendDragAndDropFailed(e,t){this.browserLink.invokeAsync("SendDragAndDropFailedTelemetry",e,t)}sendDragAndDropSucceeded(e){this.browserLink.invokeAsync("SendDragAndDropSucceededTelemetry",e)}sendActionPanelOpened(e){this.browserLink.invokeAsync("SendActionPanelOpenedTelemetry",e)}sendCloseDialogCanceled(){this.browserLink.invoke("CloseDialogCanceled")}}class zr{constructor(e){this.browserLink=e}getCurrentEditorSelectionPosition(){return Vr(this.browserLink.invokeAsync("GetCurrentEditorSelectionPosition"))}}class Kr{constructor(e){this.browserLink=e}fillTagPrefixOn3rdPartyWebControlDrop(e,t){return Vr(this.browserLink.invokeAsync("FillTagPrefixOn3rdPartyWebControlDrop",e,t))}}class Gr{createElement(e,t){return document.createElement(e,t)}}class qr{}qr.toggleWLPMenu="ctrl+alt+m",qr.toggleInteractiveMode="ctrl+alt+i",qr.toggleExpandEmptyElementsSetting="ctrl+alt+x",qr.refreshBrowser="ctrl+alt+enter",qr.tagNavigationBarSelectionLeft="shift+alt+left",qr.tagNavigationBarSelectionRight="shift+alt+right",qr.arrowUp="up",qr.arrowDown="down",qr.arrowLeft="left",qr.arrowRight="right",qr.enterTextEditingMode="ctrl+alt+e",qr.escape="escape",qr.enter="enter";class $r{}$r.normalNavigation=[qr.arrowUp,qr.arrowDown,qr.arrowLeft,qr.arrowRight],$r.menuNavigation=[qr.arrowUp,qr.arrowDown],$r.tagNavBarNavigation=[qr.arrowLeft,qr.arrowRight],$r.tagNavBarSelection=[qr.tagNavigationBarSelectionLeft,qr.tagNavigationBarSelectionRight];var Jr=n(441);class Xr{constructor(e){this.browserLink=e}initialize(){this.browserLink.log("Initializing host services..."),this.browserLink.autoSyncService.initialize(),Jr.bind(qr.refreshBrowser,(e=>{this.browserLink.refreshBrowsersService.refreshAllBrowsers()})),this.browserLink.sourceMapping.ensureUpToDateAsync((()=>{this.browserLink.log("Host service initialization finished")}))}uninitialize(e){Jr.unbind(qr.refreshBrowser),0===e?this.browserLink.invoke("DisableForPageSession"):1===e?this.browserLink.invoke("DisableForVisualStudioSession"):2===e&&this.browserLink.invoke("Disable")}}class Yr{constructor(e){this.browserLink=e}writeMessage(e,t){this.browserLink.invoke("DiagnosticGenericBrowserMessage",e,t)}writeEvent(e,t){this.browserLink.invoke("DiagnosticEvent",e,t)}writeMessageForEvent(e,t,n){this.browserLink.invoke("DiagnosticMessage",e,t,n)}}class Zr{constructor(e){this.browserLink=e}getActionItems(e){return Vr(this.browserLink.invokeAsync("GetActionPanelItems",e.start.path,e.start.position))}executeMethod(e,t,n){this.browserLink.invokeAsync("ExecuteActionMethodItem",e.start.path,e.start.position,t,n)}updateProperty(e,t,n,o){this.browserLink.invokeAsync("UpdateActionPropertyItem",e.start.path,e.start.position,t,n,o)}}class Qr{constructor(e){this.browserLink=e}doDefaultAction(e){this.browserLink.invokeAsync("DoDefaultAction",e.start.path,e.start.position)}}class ei{constructor(e){this.browserLink=e}setDesignSurfaceEnabledSettingInVS(e){this.browserLink.invokeAsync("SetClientServerCommandState",256,e)}}class ti{constructor(e){this.browserLink=e}setExpandEmptyElementsSettingInVS(e){this.browserLink.invokeAsync("SetClientServerCommandState",259,e)}}class ni{constructor(e){this.browserLink=e,e.simpleTextEditingService.textNodeBeingEditedChanged.subscribe(this.onTextNodeBeingEditedChanged.bind(this))}onTextNodeBeingEditedChanged(e,t){this.browserLink.invokeAsync("SetTextEditingState",t.isTextEditModeEnabled)}}class oi{constructor(e){this.browserLink=e,e.selectionService.selectionChanged.subscribe(this.onSelectionChanged.bind(this))}onSelectionChanged(e,t){var n,o,r;const i=null!==(n=null!==(o=t.newSelectedNode)&&void 0!==o?o:t.newPriorSiblingNode)&&void 0!==n?n:t.newParentNode;this.browserLink.invokeAsync("SetSelectionState",null==i||null===(r=i.start)||void 0===r?void 0:r.path)}}function ri(e,t){switch(e){case"Warning":return 1;case"Error":return 2;case"Info":return 0;default:return t.log("Error: setStatus() message type isn't expected. The message type value is: "+e),0}}function ii(e){if(function(){try{return window.self!==window.top}catch(e){return!0}}())return e.log("Skipping host initialization due to IFrame detection"),{applyHtmlChanges:e=>!1,onEditorSelectionChanged:(e,t)=>!1,onUpdateNeededChanged(e){},setStatus:(e,t,n)=>!1,setDesignSurfaceEnabledSetting:e=>!1,setShowEmptyElementsSetting:e=>!1,setTargetFilePath(e){},onConnected(){},onDisconnected(){}};const t=new Wr(e);e.addSharedService("telemetryService",t);const n=new Yr(e);e.addSharedService("diagnosticLog",n);const o=new Fr(e,new Gr);e.addSharedService("autoSyncService",o);const r=new Rr(e);e.addSharedService("logicalTreeEditingService",r);const i=new Ur(e);e.addSharedService("refreshBrowsersService",i);const s=new Hr(e);e.addSharedService("currentUpdateStatusService",s);const a=new zr(e);e.addSharedService("currentEditorStateService",a);const c=new Xr(e);e.addSharedService("hostLifetimeService",c);const l=new Zr(e);e.addSharedService("actionPanelService",l);const u=new Qr(e);e.addSharedService("defaultActionService",u);const d=new ei(e);e.addSharedService("designSurfaceHostService",d);const p=new ti(e);e.addSharedService("expandEmptyElementsHostService",p);const h=new Kr(e);e.addSharedService("dragAndDropHtmlFormatService",h);new ni(e),new oi(e);return{applyHtmlChanges:e=>o.applyHtmlChanges(e),setDesignSurfaceEnabledSetting:t=>(e.designSurfaceService.isEnabled=t,!0),setShowEmptyElementsSetting:t=>(e.expandEmptyElementsService.isExpansionOnEmptyElementsEnabled=t,!0),onEditorSelectionChanged:function(t,n,o){try{e.selectionHostingService.setSelectedLogicalNodeBySourceSpan(t,n,o)}catch(t){var r;const n=t instanceof Error?t.message+"\r\n"+t.stack:"Unknown Error";null===(r=e.diagnosticLog)||void 0===r||r.writeEvent(7548,n)}return!0},onUpdateNeededChanged:function(t){e.updateBrowserButtonService&&(e.updateBrowserButtonService.isButtonEnabled=t)},setStatus:function(t,n,o){var r;return!(null===(r=e.logicalTreeInitializedStatusService)||void 0===r||!r.isInitialized||!e.statusService)&&(e.statusService.currentStatus={messageType:ri(t,e),displayText:o,fullText:n},!0)},setTargetFilePath:function(t){e.statusService&&(e.statusService.targetFilePath=t)},onConnected(){e.log("Host extension connected"),c.initialize()},onDisconnected:function(){Jr.unbind(qr.refreshBrowser),this.setStatus("Warning",Nr("status.disconnectedFullMessage"),Nr("status.disconnectedShortMessage")),e.browserLinkConnectionStatusService.isConnected=!1}}}},479:function(e,t,n){e.exports=n(764).default},441:function(e,t,n){var o;!function(r,i,s){if(r){for(var a,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},l={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},d={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p=1;p<20;++p)c[111+p]="f"+p;for(p=0;p<=9;++p)c[p+96]=p.toString();b.prototype.bind=function(e,t,n){var o=this;return e=e instanceof Array?e:[e],o._bindMultiple.call(o,e,t,n),o},b.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},b.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},b.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},b.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},b.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},b.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);a=null},b.init=function(){var e=b(i);for(var t in e)"_"!==t.charAt(0)&&(b[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},b.init(),r.Mousetrap=b,1&&e.exports&&(e.exports=b),1&&(void 0===(o=function(){return b}.call(t,n,t,e))||(e.exports=o))}function h(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function f(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return c[e.which]?c[e.which]:l[e.which]?l[e.which]:String.fromCharCode(e.which).toLowerCase()}function g(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function v(e,t,n){return n||(n=function(){if(!a)for(var e in a={},c)e>95&&e<112||c.hasOwnProperty(e)&&(a[c[e]]=e);return a}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function m(e,t){var n,o,r,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),r=0;r1?p(e,a,n,o):(s=m(e,o),t._callbacks[s.key]=t._callbacks[s.key]||[],l(s.key,s.modifiers,{type:s.action},r,e,i),t._callbacks[s.key][r?"unshift":"push"]({callback:n,modifiers:s.modifiers,action:s.action,seq:r,level:i,combo:e}))}t._handleKey=function(e,t,n){var o,r=l(e,t,n),i={},d=0,p=!1;for(o=0;o-1&&this._subscriptions.splice(t,1)}},e.prototype.asEvent=function(){return this._wrap},e.prototype.clear=function(){this._subscriptions.splice(0,this._subscriptions.length)},e}();t.DispatcherBase=s;var a=function(){function e(){this._events={}}return e.prototype.get=function(e){var t=this._events[e];return t||(t=this.createDispatcher(),this._events[e]=t,t)},e.prototype.remove=function(e){delete this._events[e]},e}();t.EventListBase=a;var c=function(){function e(e){this._subscribe=function(t){return e.subscribe(t)},this._unsubscribe=function(t){return e.unsubscribe(t)},this._one=function(t){return e.one(t)},this._has=function(t){return e.has(t)},this._clear=function(){return e.clear()},this._count=function(){return e.count}}return Object.defineProperty(e.prototype,"count",{get:function(){return this._count()},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){return this._subscribe(e)},e.prototype.sub=function(e){return this.subscribe(e)},e.prototype.unsubscribe=function(e){this._unsubscribe(e)},e.prototype.unsub=function(e){this.unsubscribe(e)},e.prototype.one=function(e){return this._one(e)},e.prototype.has=function(e){return this._has(e)},e.prototype.clear=function(){this._clear()},e}();t.DispatcherWrapper=c},210:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=t.EventListBase=t.DispatcherWrapper=t.DispatcherBase=void 0;var o=n(349);Object.defineProperty(t,"DispatcherBase",{enumerable:!0,get:function(){return o.DispatcherBase}}),Object.defineProperty(t,"DispatcherWrapper",{enumerable:!0,get:function(){return o.DispatcherWrapper}}),Object.defineProperty(t,"EventListBase",{enumerable:!0,get:function(){return o.EventListBase}});var r=n(422);Object.defineProperty(t,"Subscription",{enumerable:!0,get:function(){return r.Subscription}})},144:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventManagement=void 0;var n=function(){function e(e){this.unsub=e,this.propagationStopped=!1}return e.prototype.stopPropagation=function(){this.propagationStopped=!0},e}();t.EventManagement=n},422:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=void 0;var n=function(){function e(e,t){this.handler=e,this.isOnce=t,this.isExecuted=!1}return e.prototype.execute=function(e,t,n){if(!this.isOnce||!this.isExecuted){this.isExecuted=!0;var o=this.handler;e?setTimeout((function(){o.apply(t,n)}),1):o.apply(t,n)}},e}();t.Subscription=n},685:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.EventHandlingBase=t.EventList=t.NonUniformEventList=t.EventDispatcher=void 0;var i=n(210),s=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.dispatch=function(e,t){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(e,t){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(i.DispatcherBase);t.EventDispatcher=s;var a=function(){function e(){this._events={}}return e.prototype.get=function(e){if(this._events[e])return this._events[e];var t=this.createDispatcher();return this._events[e]=t,t},e.prototype.remove=function(e){delete this._events[e]},e.prototype.createDispatcher=function(){return new s},e}();t.NonUniformEventList=a;var c=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.createDispatcher=function(){return new s},t}(i.EventListBase);t.EventList=c;var l=function(){function e(){this._events=new c}return Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e}();t.EventHandlingBase=l},132:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonUniformEventList=t.EventList=t.EventHandlingBase=t.EventDispatcher=void 0;var o=n(685);Object.defineProperty(t,"EventDispatcher",{enumerable:!0,get:function(){return o.EventDispatcher}}),Object.defineProperty(t,"EventHandlingBase",{enumerable:!0,get:function(){return o.EventHandlingBase}}),Object.defineProperty(t,"EventList",{enumerable:!0,get:function(){return o.EventList}}),Object.defineProperty(t,"NonUniformEventList",{enumerable:!0,get:function(){return o.NonUniformEventList}})},106:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalList=t.SignalHandlingBase=t.SignalDispatcher=void 0;var o=n(141);Object.defineProperty(t,"SignalDispatcher",{enumerable:!0,get:function(){return o.SignalDispatcher}}),Object.defineProperty(t,"SignalHandlingBase",{enumerable:!0,get:function(){return o.SignalHandlingBase}}),Object.defineProperty(t,"SignalList",{enumerable:!0,get:function(){return o.SignalList}})},141:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SignalHandlingBase=t.SignalList=t.SignalDispatcher=void 0;var i=n(210),s=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.dispatch=function(){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(i.DispatcherBase);t.SignalDispatcher=s;var a=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.createDispatcher=function(){return new s},t}(i.EventListBase);t.SignalList=a;var c=function(){function e(){this._events=new a}return Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e}();t.SignalHandlingBase=c},602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonUniformSimpleEventList=t.SimpleEventList=t.SimpleEventHandlingBase=t.SimpleEventDispatcher=void 0;var o=n(699);Object.defineProperty(t,"SimpleEventDispatcher",{enumerable:!0,get:function(){return o.SimpleEventDispatcher}}),Object.defineProperty(t,"SimpleEventHandlingBase",{enumerable:!0,get:function(){return o.SimpleEventHandlingBase}}),Object.defineProperty(t,"SimpleEventList",{enumerable:!0,get:function(){return o.SimpleEventList}}),Object.defineProperty(t,"NonUniformSimpleEventList",{enumerable:!0,get:function(){return o.NonUniformSimpleEventList}})},699:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleEventHandlingBase=t.SimpleEventList=t.NonUniformSimpleEventList=t.SimpleEventDispatcher=void 0;var i=n(210),s=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.dispatch=function(e){this._dispatch(!1,this,arguments)},t.prototype.dispatchAsync=function(e){this._dispatch(!0,this,arguments)},t.prototype.asEvent=function(){return e.prototype.asEvent.call(this)},t}(i.DispatcherBase);t.SimpleEventDispatcher=s;var a=function(){function e(){this._events={}}return e.prototype.get=function(e){if(this._events[e])return this._events[e];var t=this.createDispatcher();return this._events[e]=t,t},e.prototype.remove=function(e){delete this._events[e]},e.prototype.createDispatcher=function(){return new s},e}();t.NonUniformSimpleEventList=a;var c=function(e){function t(){return e.call(this)||this}return r(t,e),t.prototype.createDispatcher=function(){return new s},t}(i.EventListBase);t.SimpleEventList=c;var l=function(){function e(){this._events=new c}return Object.defineProperty(e.prototype,"events",{get:function(){return this._events},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e,t){this._events.get(e).subscribe(t)},e.prototype.sub=function(e,t){this.subscribe(e,t)},e.prototype.one=function(e,t){this._events.get(e).one(t)},e.prototype.has=function(e,t){return this._events.get(e).has(t)},e.prototype.unsubscribe=function(e,t){this._events.get(e).unsubscribe(t)},e.prototype.unsub=function(e,t){this.unsubscribe(e,t)},e}();t.SimpleEventHandlingBase=l},993:function(e,t,n){"use strict";var o=n(210);o.DispatcherBase,o.DispatcherWrapper,o.EventListBase,o.Subscription;var r=n(132);r.EventDispatcher,r.EventHandlingBase,r.EventList,r.NonUniformEventList;var i=n(602);t.FK=i.SimpleEventDispatcher,i.SimpleEventHandlingBase,i.SimpleEventList,i.NonUniformSimpleEventList;var s=n(106);s.SignalDispatcher,s.SignalHandlingBase,s.SignalList}},t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}return n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(479)}();; this.addExtension("Microsoft.WebTools.BrowserLink.LivePreview.LivePreviewExtensionFactory", extension); }} catch(e) {{ this.log("Invalid extension script encountered for extension 'Microsoft.WebTools.BrowserLink.LivePreview.LivePreviewExtensionFactory'."); return; }} },generateId:function(){return this.nextId++,this.nextId<0&&(this.nextId=0),this.nextId},removeTask:function(n){delete this.callbackTable[n]},addExtension:function(f,e){var o={},s,h,c,l;if(typeof e!="function"){this.log("Extension function definition was not defined as a function object.");return}h=function(n,t){if(typeof n=="undefined")throw new Error("Browser Link: Method call failed, missing method name argument.");if(!t)throw new Error('Method call failed, missing class name. Use the format "namespace."methodName"');return t+"."+n};c=function(n){for(var i=[],t=1;t=0||navigator.userAgent.search(/trident/i)>=0?!0:!1},r()&&(u=window.location,t=window.document.createElement("a"),t.href=n,i=function(n){return n&&n.indexOf(".")<0?!0:!1},i(t.hostname)&&!i(u.hostname)))return!1;try{return f=new XMLHttpRequest,f.open("get",n),!0}catch(e){return!1}};o(i.connection.url)?i.connection.start().done(f):i.connection.start({transport:"longPolling",jsonp:!0}).done(f)}};n(window).on("beforeunload",function(){i.isUnloading=!0});if(i.initialize(),window._vwdonbeforeunload)n(window).on("beforeunload",window._vwdonbeforeunload)})($.noConflict(!0),JSON);window._vwdJSON&&(JSON=window._vwdJSON);window._vwdDefine&&(define=window._vwdDefine);