UNPKG

halleyx-ui-framework

Version:

The Halleyx UI Framework is a Vue 3 component framework.

1 lines 1.98 MB
import{openBlock as e,createElementBlock as i,Fragment as a,createCommentVNode as t,createElementVNode as o,renderSlot as n,createBlock as l,Teleport as s,renderList as r,normalizeClass as c,toDisplayString as d,createTextVNode as m,createStaticVNode as u,normalizeStyle as f,resolveComponent as p,withCtx as h,defineComponent as g,h as y,ref as b,createVNode as v,withModifiers as k,withDirectives as _,vShow as w,vModelText as S,toRaw as C,mergeProps as x,withKeys as A,resolveDirective as R,vModelDynamic as E,inject as M,provide as I}from"vue";import{VueDraggableNext as $}from"vue-draggable-next";import T from"vue3-apexcharts";import{Chart as N}from"chart.js";import*as B from"chartjs-chart-geo";import{ChoroplethController as O,GeoFeature as P,ColorScale as q,ProjectionScale as L}from"chartjs-chart-geo";var D={name:"HlxAccordion",props:{accordionData:{type:Array,default:()=>[]},direction:{type:String,default:"right"},multiple:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},headerBorder:{type:Boolean,default:!1}},emits:["accordionopen","accordionclose"],data:()=>({unique:Date.now().toString(36)+Math.random().toString(36).substr(2,5)}),mounted(){this.expand&&document.querySelectorAll(".accordion-item")?.forEach(e=>{e?.children[0]?.children[1]?.children[0]?.classList?.remove("icon-angle-right-regular"),e?.children[0]?.children[1]?.children[0]?.classList?.add("icon-angle-down-regular"),e.children[1].style.display="flex",this.$emit("accordionopen")})},methods:{toggleView(e,i,a){0==a?"right icon-angle-right-regular"===document.querySelector("#arrow-"+i).className?(0==this.headerBorder&&(document.querySelectorAll(".accordion-header").forEach(e=>{e.classList.remove("noo-border")}),document.querySelector("#header-"+i)&&document.querySelector("#header-"+i).classList.add("noo-border")),document.querySelectorAll(".icon-angle-down-regular").forEach(e=>{"right icon-angle-down-regular"==e.className&&(document.querySelectorAll(".accordion-content").forEach(e=>{e.style.display="none"}),e.classList.remove("icon-angle-down-regular"),e.classList.add("icon-angle-right-regular"))}),document.querySelector("#arrow-"+i).classList.remove("icon-angle-right-regular"),document.querySelector("#arrow-"+i).classList.add("icon-angle-down-regular"),document.querySelector("#content-"+i).style.display="flex",this.$emit("accordionopen")):"right icon-angle-down-regular"===document.querySelector("#arrow-"+i).className&&(0==this.headerBorder&&(document.querySelectorAll(".accordion-header").forEach(e=>{e.classList.remove("noo-border")}),document.querySelector("#header-"+i)&&document.querySelector("#header-"+i).classList.add("noo-border")),document.querySelector("#arrow-"+i).classList.remove("icon-angle-down-regular"),document.querySelector("#arrow-"+i).classList.add("icon-angle-right-regular"),document.querySelector("#content-"+i).style.display="none",this.$emit("accordionclose")):"right icon-angle-right-regular"===document.querySelector("#arrow-"+i).className?(0==this.headerBorder&&document.querySelector("#header-"+i)&&document.querySelector("#header-"+i).classList.add("noo-border"),document.querySelector("#arrow-"+i).classList.remove("icon-angle-right-regular"),document.querySelector("#arrow-"+i).classList.add("icon-angle-down-regular"),document.querySelector("#content-"+i).style.display="flex",this.$emit("accordionopen")):"right icon-angle-down-regular"===document.querySelector("#arrow-"+i).className&&(document.querySelector("#header-"+i)&&document.querySelector("#header-"+i).classList.remove("noo-border"),document.querySelector("#arrow-"+i).classList.remove("icon-angle-down-regular"),document.querySelector("#arrow-"+i).classList.add("icon-angle-right-regular"),document.querySelector("#content-"+i).style.display="none",this.$emit("accordionclose"))}}};const z=["id","multiple"],V=["id"],j={key:0,style:{display:"flex"}},F=["id"],U={style:{width:"100%"}},K={key:1,style:{display:"flex"}},G=["id"],H=["id"];D.render=function(l,s,r,c,d,m){return e(),i(a,null,[t(' <div class="accordion-container"> '),(e(),i("div",{id:["item-"+d.unique],key:d.unique,class:"accordion-item",multiple:r.multiple},[o("div",{id:["header-"+d.unique],class:"accordion-header",onClick:s[0]||(s[0]=e=>m.toggleView(e,d.unique,r.multiple))},["left"==r.direction?(e(),i("div",j,[o("i",{id:["arrow-"+d.unique],class:"right icon-angle-right-regular"},null,8,F)])):t("v-if",!0),o("header",U,[n(l.$slots,"item-title")]),"right"==r.direction?(e(),i("div",K,[o("i",{id:["arrow-"+d.unique],class:"right icon-angle-right-regular"},null,8,G)])):t("v-if",!0)],8,V),o("div",{id:["content-"+d.unique],class:"accordion-content"},[n(l.$slots,"item-body")],8,H)],8,z)),t(" </div> ")],2112)},D.__file="src/components/AccordionComponent.vue";var W={name:"HlxAlertNotification",props:{notify:{type:Object,default:()=>({})},autoClose:{type:Boolean,default:()=>!0},delay:{type:Number,default:e=>e>3e3?e:2e3,validator:e=>e>3e3?e:2e3}},data:()=>({notifications:[],alertStatus:!1,typeData:""}),computed:{computedAlert(){return this.alertStatus}},watch:{notify:{handler(e){const i=(new Date).toISOString().replace(/[.\:-]/g,"")+crypto.randomUUID().toString(16).substring(1);Object.keys(e).length>0&&this.push({...e,id:i})},immediate:!0,deep:!0}},methods:{closeAlert(e){this.$refs["hlx-alert-"+e][0]?.classList.add("close"),setTimeout(()=>{this.notifications=this.notifications.filter(i=>i.id&&i.id!=e)},1e3)},push(e){this.notifications.push({...e}),this.autoClose&&setTimeout(()=>{this.$refs["hlx-alert-"+e.id][0]?.classList.add("close"),setTimeout(()=>{this.notifications.shift()},1e3)},this.delay+1e3*this.notifications.length)},icon(e){if(e)switch(e.toLowerCase()){case"danger":case"warning":return"icon-exclamation-circle-regular";case"primary":return"icon-info-circle-regular";default:return"icon-check-circle-regular"}return"tick-bg"}}};const J={key:0,class:"hlx-alert-wrapper"},Z=["id"],Y={class:"icon"},X={class:"text"},Q={class:"alert-description"},ee=["onClick"];W.render=function(n,m,u,f,p,h){return e(),l(s,{to:"body",class:"alert-not"},[p.notifications.length>0?(e(),i("section",J,[(e(!0),i(a,null,r(p.notifications,a=>(e(),i("div",{id:"alert"+a.id,ref_for:!0,ref:"hlx-alert-"+a.id,key:a,class:c(["hlx alert",a?.type?"alert-"+a?.type.toLowerCase():"alert-success"])},[o("span",Y,[o("i",{class:c(h.icon(a.type))},null,2)]),o("div",X,[o("p",Q,d(a?.message),1)]),o("button",{class:"close","aria-label":"close",onClick:e=>h.closeAlert(a.id)},[...m[0]||(m[0]=[o("i",{class:"icon-times-filled"},null,-1)])],8,ee)],10,Z))),128))])):t("v-if",!0)])},W.__file="src/components/AlertComponent.vue";var ie={name:"HlxBadge",props:{icon:{type:String,default:""},count:{type:Number,default:0}}};const ae=["aria-label"],te={class:"icon-button__badge",style:{"font-size":"10px"}};ie.render=function(a,t,n,l,s,r){return e(),i("button",{id:"badge",type:"button",class:"icon-button","aria-label":n.icon},[o("span",{class:c(n.icon)},null,2),o("span",te,d(n.count),1)],8,ae)},ie.__file="src/components/BadgeComponent.vue";var oe={name:"HlxBreadcrumb",props:{labelValue:{type:String,default:"Back"},autoRoute:{type:Boolean,default:!1},type:{type:String,default:"back-breadcrumb"},items:{type:Array,required:!0},separator:{type:[String,Object],default:"/"}},emits:["path"],data:()=>({unique:Date.now().toString(36)+Math.random().toString(36).substr(2,5)}),computed:{isIconSeparator(){return"object"==typeof this.separator}},methods:{current(e){!0===this.autoRoute&&this.$router.back(),this.$emit("path",e)},tooltipover(e,i){let a=e,t=i;this.ellipsis(a,t)},tooltipleave(e,i){let a=e,t=i;this.ellipses(a,t)},ellipsis(e,i){this.$nextTick(()=>{const a=document.querySelector("#"+e);if(null!=a){if(a.clientWidth<a.scrollWidth)if("ellipsis"===(a.currentStyle||window.getComputedStyle(a)).textOverflow){const e=document.querySelector("."+i);let t=a.getBoundingClientRect().top,o=a.getBoundingClientRect().left+77;return e.style.display="block",e.style.top=t+"px",e.style.left=o+"px",!0}return!1}})},ellipses(e,i){this.$nextTick(()=>{const a=document.querySelector("#"+e);if(null!=a){if(a.clientWidth<a.scrollWidth)if("ellipsis"===(a.currentStyle||window.getComputedStyle(a)).textOverflow){return document.querySelector("."+i).style.display="none",!0}return!1}})}}};const ne={class:"breadcrumb","aria-label":"Breadcrumb"},le={key:0},se=["onClick"],re=["id","onMouseover","onMouseleave"],ce=["id","onMouseover","onMouseleave"],de={key:3,class:"breadcrumb-separator"},me={key:1};oe.render=function(n,l,s,u,f,p){return e(),i("nav",ne,["Pathway-breadcrumb"===s.type?(e(),i("ul",le,[(e(!0),i(a,null,r(s.items,(a,n)=>(e(),i("li",{key:n,onClick:e=>p.current(a)},[null!=a.icon?(e(),i("i",{key:0,"aria-hidden":"true",class:c(a.icon)},null,2)):t("v-if",!0),n===s.items.length-1?(e(),i("a",{key:1,id:"breadcrumb"+n+f.unique,style:{"white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis","min-width":"45px",width:"auto","max-width":"80px",display:"inline-block"},onMouseover:e=>p.tooltipover("breadcrumb"+n+f.unique,"tooltip-textbreadcrumb"+n+f.unique),onMouseleave:e=>p.tooltipleave("breadcrumb"+n+f.unique,"tooltip-textbreadcrumb"+n+f.unique)},[m(d(a.label)+" ",1),o("p",{id:"tooltip-text1",class:c("tooltip-textbreadcrumb"+n+f.unique)},d(a.label),3)],40,re)):(e(),i("a",{key:2,id:"breadcrumb"+f.unique+n,class:"show-breadcrumb",style:{"white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis","min-width":"45px",width:"auto","max-width":"80px",display:"inline-block"},onMouseover:e=>p.tooltipover("breadcrumb"+f.unique+n,"tooltip-textbreadcrumb"+f.unique+n),onMouseleave:e=>p.tooltipleave("breadcrumb"+f.unique+n,"tooltip-textbreadcrumb"+f.unique+n)},[m(d(a.label)+" ",1),o("p",{id:"tooltip-text1",class:c("tooltip-textbreadcrumb"+f.unique+n)},d(a.label),3)],40,ce)),t(' <router-link :to="item.link" :class="{ disabled: index === items.length - 1 } " >{{ item.label }}</router-link> '),n<s.items.length-1?(e(),i("span",de,[p.isIconSeparator?(e(),i("i",{key:0,"aria-hidden":"true",class:c(s.separator.icon)},null,2)):(e(),i("span",me,d(s.separator),1))])):t("v-if",!0)],8,se))),128))])):t("v-if",!0),"back-breadcrumb"===s.type?(e(),i("div",{key:1,class:"back-breadcrumb",style:{display:"flex",cursor:"pointer","align-items":"center",gap:"8px","max-width":"100px"},onClick:l[0]||(l[0]=e=>p.current("back"))},[l[1]||(l[1]=o("i",{style:{"font-weight":"800"},class:"icon-arrow-left-regular"},null,-1)),o("p",null,d(s.labelValue),1)])):t("v-if",!0)])},oe.__file="src/components/BreadcrumbComponent.vue";var ue={name:"HlxButton",props:{value:{type:String,default:"Hlx click :)"},type:{type:String,default:"button"},name:{type:String,default:"hlx-button"},target:{type:String,default:"_blank"},href:{type:String,default:void 0},disabled:{type:Boolean,default:!1},label:{type:String,default:"Button"}},computed:{primaryClass(){return this.disabled?"disabled-button":""}},watch:{disabled:{handler(e){e&&this.primaryClass},immediate:!0}},methods:{clicked(){this.href&&this.$refs["link-ele"].click()}}};const fe=["value","type","name","aria-label"],pe=["aria-label","href","target"];ue.render=function(a,o,l,s,r,d){return e(),i("button",{id:"hlx-button-0009",ref:"hlx-button",value:l.value,type:l.type,name:l.name,class:c([d.primaryClass,"hlx-button"]),"aria-label":l.label,onClick:o[0]||(o[0]=(...e)=>d.clicked&&d.clicked(...e))},[n(a.$slots,"default"),null!=l.href?(e(),i("a",{key:0,ref:"link-ele","aria-label":l.label,href:l.href,target:l.target},null,8,pe)):t("v-if",!0)],10,fe)},ue.__file="src/components/ButtonComponent.vue";var he={name:"HlxCalendar",props:{disableWeekend:{type:Boolean,default:!1},dateFormatLanguage:{type:String,default:"en"},event:{type:[Array,PointerEvent],default:()=>[]},preValue:{type:[Date,String],default:""},startYear:{type:Number,default:1950},endYear:{type:Number,default:2050},holidayList:{type:Array,default:()=>[]}},emits:["selectedDate","formattedDate"],data:()=>({selectedMonth:"",selectedYear:"",selectedDay:"",formattedDate:"",staticDataDays:localStorage.getItem("dayDataShort")?JSON.parse(localStorage.getItem("dayDataShort")):{sun:"SUN",mon:"MON",tue:"TUE",wed:"WED",thu:"THU",fri:"FRI",sat:"SAT"},monthNames:localStorage.getItem("monthDataLong")?JSON.parse(localStorage.getItem("monthDataLong")):["January","February","March","April","May","June","July","August","September","October","November","December"]}),async mounted(){const e=document.querySelector(".calendar"),i=document.querySelector(".light");e.clientY=this.event.clientY,i.right=this.event.clientX+"px";const a=["January","February","March","April","May","June","July","August","September","October","November","December"],t=[];let o=this.startYear;const n=this.endYear;for(;o<=n;)t.push(o++);const l=e.querySelector(".month-list");t.forEach((e,i)=>{const a=document.createElement("div");a.innerHTML=`<div data-month="${i}" id="year${i}" class="idd${e}">${e}</div>`;let t=(new Date).getFullYear();t+=1,e===t&&(document.getElementById("year"+(i-1)).classList.add("theme-background"),document.getElementById("year"+(i-1)).style.color="white"),a.querySelector("div").onclick=()=>{l.classList.remove("show"),c.value=e,this.selectedMonth=r.value,this.selectedYear=c.value,this.generateCalendar(r.value,c.value)},l.appendChild(a)});e.querySelector("#year").onclick=()=>{l.classList.add("show"),document.querySelector(".selected-curr-year")?.classList?.remove("selected-curr-year");let e=document.querySelector(".idd"+this.selectedYear);e.classList.add("selected-curr-year"),e.scrollIntoView({behavior:"smooth",block:"start"})};let s="";if(""===this.preValue)s=new Date;else{const e=this.preValue.split("-");s=new Date(e[2],e[1]-1,e[0])}const r={value:s.getMonth()},c={value:s.getFullYear()};this.selectedMonth=r.value,this.selectedYear=c.value,this.generateCalendar(r.value,c.value);const d=document.querySelector(".calendar");340===d.offsetHeight||(d.style.marginTop="0px"),document.querySelector("#prev-year").onclick=()=>{"January"===a[r.value]?(r.value=11,--c.value):--r.value,this.selectedMonth=r.value,this.selectedYear=c.value,this.generateCalendar(r.value,c.value);const e=document.querySelector(".calendar");340===e.offsetHeight||(e.style.marginTop="0")},document.querySelector("#next-year").onclick=()=>{const e=document.querySelector(".calendar");"December"===a[r.value]?(r.value=0,++c.value):++r.value,this.selectedMonth=r.value,this.selectedYear=c.value,this.generateCalendar(r.value,c.value),340===e.offsetHeight||(e.style.marginTop="0")};document.querySelectorAll(".disable-weekend").forEach(e=>{e.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault()})})},methods:{async translateStaticDataDays(e,i){const a=Object.keys(e).map(i=>e[i]),t=await this.languageTransferArray(a,i),o=Object.keys(e).reduce((e,i,a)=>(e[i]=t[a],e),{});return o},hlxUIKitCalendarOnClickHandler(e){try{""!==e.target.innerHTML&&e.target.innerHTML.length<=2&&(e.target.innerHTML.length<2?this.selectedDay=0+e.target.innerHTML:this.selectedDay=e.target.innerHTML,this.selectedDate=this.selectedDay+"-"+(this.selectedMonth+1<10?"0"+String(this.selectedMonth+1):this.selectedMonth+1)+"-"+this.selectedYear,this.$emit("selectedDate",this.selectedDate))}catch(e){this.$emit("selectedDate",null)}},isLeapYear:e=>e%4==0&&e%100!=0&&e%400!=0||e%100==0&&e%400==0,getFebDays(e){return this.isLeapYear(e)?29:28},generateCalendar(e,i){const a=document.querySelector(".calendar"),t=a.querySelector(".calendar-days"),o=a.querySelector("#year"),n=[31,this.getFebDays(i),31,30,31,30,31,31,30,31,30,31];t.innerHTML="";let l="";if(""===this.preValue)l=new Date;else{const e=this.preValue.split("-");l=new Date(e[2],e[1]-1,e[0])}i||(i=l.getFullYear());const s=`${this.monthNames[e]}`;a.querySelector("#month-picker").innerHTML=s,o.innerHTML=i;const r=new Date(i,e,1);for(let a=0;a<=n[e]+r.getDay()-1;a++){const o=document.createElement("div");if(a>=r.getDay()){o.classList.add("calendar-day-hover");const t=a-r.getDay()+1;if(t>0&&t<=n[e]){const a=`${t}-${e+1}-${i}`;o.classList.add(a),o.id="calender-day",this.holidayList.includes(a)&&(o.classList.remove("calendar-day-hover"),o.classList.add("disable-weekend")),o.innerHTML=t,t===l.getDate()&&i===l.getFullYear()&&e===l.getMonth()&&o.classList.add("curr-date")}}t.appendChild(o)}if(!0===this.disableWeekend){const e=document.querySelector(".calendar-days").children,i=[0,6,7,13,14,20,21,27,28,34,35];for(const a in i)e[i[a]]&&""!==e[i[a]].innerHTML&&(e[i[a]].classList.remove("calendar-day-hover"),e[i[a]].classList.add("disable-weekend"))}}}};const ge={class:"light"},ye={class:"calendar"},be={class:"calendar-body"},ve={class:"calendar-week-day"};he.render=function(a,n,l,s,r,c){return e(),i("div",ge,[o("div",ye,[n[1]||(n[1]=u('<div class="calendar-header"><div class="year-picker"><span id="prev-year" class="year-change"><p style="margin:0px;"><i class="icon-angle-left-regular"></i></p></span><span><span id="month-picker" class="month-picker">February</span><span id="year">2021</span></span><span id="next-year" class="year-change"><p style="margin:0px;"><i class="icon-angle-right-regular"></i></p></span></div></div>',1)),o("div",be,[o("div",ve,[o("div",null,[t(" SUN "),m(" "+d(r.staticDataDays?.sun),1)]),o("div",null,[t(" MON "),m(" "+d(r.staticDataDays?.mon),1)]),o("div",null,[t(" TUE "),m(" "+d(r.staticDataDays?.tue),1)]),o("div",null,[t(" WED "),m(" "+d(r.staticDataDays?.wed),1)]),o("div",null,[t(" THU "),m(" "+d(r.staticDataDays?.thu),1)]),o("div",null,[t(" FRI "),m(" "+d(r.staticDataDays?.fri),1)]),o("div",null,[t(" SAT "),m(" "+d(r.staticDataDays?.sat),1)])]),o("div",{class:"calendar-days",onClick:n[0]||(n[0]=(...e)=>c.hlxUIKitCalendarOnClickHandler&&c.hlxUIKitCalendarOnClickHandler(...e))})]),t(' <div class="calendar-footer">\n\n </div> '),n[2]||(n[2]=o("div",{class:"month-list"},null,-1))])])},he.__file="src/components/CalendarComponent.vue";var ke={name:"HlxCard",components:{},props:{cardTitle:{type:Boolean,default:!1},cardFooter:{type:Boolean,default:!1},width:{type:Number,default:null},hover:{type:Boolean,default:!1},shadow:{type:Boolean,default:!1},padding:{type:Boolean,default:!1},active:{type:Boolean,default:!1},height:{type:Number,default:null}},computed:{headerHeight(){return this.cardTitle?60:0},footerHeight(){return this.cardFooter?60:0}},mounted(){}};const _e={key:0,class:"card-title"},we={key:1,class:"card-footer"};ke.render=function(a,l,s,r,d,u){return e(),i("div",{class:c(["card",{cardhover:s.hover,cardshadow:s.shadow,padding:s.padding,cardActive:s.active}]),style:f("width:"+s.width+"px; height:"+s.height+"px;")},[1==s.cardTitle?(e(),i("div",_e,[o("header",null,[n(a.$slots,"card-title",{},()=>[l[0]||(l[0]=m("Card title",-1))])])])):t("v-if",!0),o("div",{class:"card-body",style:f(s.cardTitle&&s.cardFooter?{height:s.height-u.headerHeight-u.footerHeight+"px"}:{height:"100%"})},[t(" {{this.card_body}} "),o("main",null,[n(a.$slots,"card-body",{},()=>[l[1]||(l[1]=m("Card body",-1))])])],4),1==s.cardFooter?(e(),i("div",we,[t(" {{this.cardFooter}} "),o("footer",null,[n(a.$slots,"card-footer",{},()=>[l[2]||(l[2]=m("Card footer",-1))])])])):t("v-if",!0)],6)},ke.__file="src/components/CardsComponent.vue";var Se={props:{show:{type:Boolean,default:!1},height:{type:Number,default:0},top:{type:Number,default:0},width:{type:Number,default:0},left:{type:Number,default:0},conditionvalue:{type:Number,default:0},conditionup:{type:Number,default:0},conditiondown:{type:Number,default:0},search:{type:String,default:""}},emits:["close-overlay"],data:()=>({unique:Date.now().toString(36)+Math.random().toString(36).substr(2,5),containertop:0,containerwidth:0,containerleft:0,containerheight:0}),watch:{search:{handler(e){1==this.show?this.$nextTick(()=>{this.containerheight=document.querySelector("#container-overlay"+this.unique).offsetHeight,this.containertop=this.top,this.containerleft=this.left,this.containerwidth=this.width,window.innerHeight-this.containertop<this.conditionvalue?this.containertop=this.containertop-(this.containerheight+this.conditionup):this.containertop=this.containertop+this.conditiondown}):(this.containertop=0,this.containerleft=0,this.containerwidth=0,this.containerheight=0)}},show:{handler(e){1==e?this.$nextTick(()=>{this.containerheight=document.querySelector("#container-overlay"+this.unique).offsetHeight,this.containertop=this.top,this.containerleft=this.left,this.containerwidth=this.width,window.innerHeight-this.containertop<this.conditionvalue?this.containertop=this.containertop-(this.containerheight+this.conditionup):this.containertop=this.containertop+this.conditiondown}):(this.containertop=0,this.containerleft=0,this.containerwidth=0,this.containerheight=0)}},top:{handler(e){this.containertop=e,1==this.show?this.$nextTick(()=>{this.containerheight=document.querySelector("#container-overlay"+this.unique).offsetHeight,this.containertop=this.top,this.containerleft=this.left,this.containerwidth=this.width,window.innerHeight-this.containertop<this.conditionvalue?this.containertop=this.containertop-(this.containerheight+this.conditionup):this.containertop=this.containertop+this.conditiondown}):(this.containertop=0,this.containerleft=0,this.containerwidth=0,this.containerheight=0)},immediate:!0,deep:!0},left:{handler(e){this.containerleft=e},immediate:!0,deep:!0},width:{handler(e){this.containerwidth=e},immediate:!0,deep:!0}},methods:{emitfunction(e){this.$emit("close-overlay",e)}}};const Ce=["id"];Se.render=function(a,t,l,s,r,c){return e(),i("div",{class:"outer-overlay",onClick:t[0]||(t[0]=(...e)=>c.emitfunction&&c.emitfunction(...e))},[o("div",{id:"container-overlay"+r.unique,class:"container-overlay",style:f([{position:"fixed"},["width:"+l.width+"px","top:"+r.containertop+"px","left:"+l.left+"px"]])},[n(a.$slots,"overlay")],12,Ce)])},Se.__file="src/components/OverlayComponent.vue";var xe={name:"HlxColorPalette",components:{hlxOverlay:Se},props:{preValue:{type:String,default:"#000000"},highlightColor:{type:Boolean,default:!1}},emits:["customChange"],data:()=>({containerleft:0,containertop:0,unique:Date.now().toString(36)+Math.random().toString(36).substr(2,5),colorcontainer:!1,fill_color:!0,colorvalue:"#000000",recent:!1,recentvalue:"",recentcolor:[],colordata:[{"#ffffff":["#f2f2f2","#d9d9d9","#bfbfbf","#a6a6a6","#808080"]},{"#000000":["#808080","#595959","#404040","#262626","#0d0d0d"]},{"#e7e6e6":["#d0cece","#aeaaaa","#757171","#3a3838","#161616"]},{"#44546a":["#d6dce4","#acb9ca","#8497b0","#333f4f","#222b35"]},{"#4472c4":["#d9e1f2","#b4c6e7","#8ea9db","#305496","#203764"]},{"#ed7d31":["#fce4d6","#f8cbad","#f4b084","#c65911","#833c0c"]},{"#a5a5a5":["#ededed","#dbdbdb","#c9c9c9","#7b7b7b","#525252"]},{"#ffc000":["#fff2cc","#ffe699","#ffd966","#bf8f00","#806000"]},{"#5b9bd5":["#ddebf7","#bdd7ee","#9bc2e6","#2f75b5","#1f4e78"]},{"#70ad47":["#e2efda","#c6e0b4","#a9d08e","#548235","#375623"]}],standardcolor:["#c00000","#ff0000","#ffc000","#ffff00","#92d050","#00b050","#00b0f0","#0070c0","#002060","#7030a0"],colorpick:""}),watch:{preValue:{handler(e){""!=e&&(this.colorvalue=e,this.$emit("customChange",this.colorvalue))},immediate:!0,deep:!0}},mounted(){!0===this.highlightColor?this.fill_color=!1:this.fill_color=!0;for(let e=0;e<this.colordata.length;e++)for(let i=0;i<Object.values(this.colordata[e])[0].length;i++);document.addEventListener("click",e=>{"color-container"!=e.target.className&&"color-container-title"!=e.target.className&&"color-container-specific-color-checkbox-border"!=e.target.className&&"color-container-specific-color-checkbox-border-fill-color"!=e.target.className&&"color-container-specific-color"!=e.target.className&&"color-container-specific-color1"!=e.target.className&&"color-container-specific-color2"!=e.target.className&&"color-container-specific-color1-container"!=e.target.className&&"color-container2323"!=e.target.className&&"favcolor"!=e.target.className&&"color-palette-container"!=e.target.className&&"color-palette-icon"!=e.target.className&&"icon-color-fill"!=e.target.className&&"color-icon-border"!=e.target.className&&"color-palette-open-icon"!=e.target.className&&"icon-angle-down-regular"!=e.target.className&&(this.colorcontainer=!1)})},methods:{getcolorvalue(e){this.recent=!0,this.colorvalue=e.target.value,this.$emit("customChange",this.colorvalue),1!=this.recentcolor.includes(this.colorvalue)&&(document.querySelectorAll(".color-container-specific-color-checkbox-border").forEach(e=>{e.classList.remove("add-border")}),this.recentvalue=this.colorvalue,this.recentcolor.push(this.colorvalue))},getcolor(e){document.querySelectorAll(".color-container-specific-color-checkbox-border").forEach(e=>{e.classList.remove("add-border")}),"color-container-specific-color-checkbox-border-fill-color"===e.target.className?(this.colorvalue=e.target.style.background,this.$emit("customChange",this.colorvalue),e.target.parentElement.classList.add("add-border"),this.colorcontainer=!1):"color-container-specific-color-checkbox-border"===e.target.className&&(this.colorvalue=e.target.children[0].style.background,this.$emit("customChange",this.colorvalue),e.target.classList.add("add-border"),this.colorcontainer=!1),this.recent=!0,1!=this.recentcolor.includes(this.colorvalue)&&(document.querySelectorAll(".color-container-specific-color-checkbox-border").forEach(e=>{e.classList.remove("add-border")}),this.recentvalue=this.colorvalue,this.recentcolor.push(this.colorvalue))},colorpalette(){this.$nextTick(()=>{this.containerleft=document.getElementById("color-palette-open-icon"+this.unique).getBoundingClientRect().left+5,this.containertop=document.getElementById("color-palette-open-icon"+this.unique).getBoundingClientRect().top+50}),!1===this.colorcontainer?this.colorcontainer=!0:!0===this.colorcontainer&&(this.colorcontainer=!1)},colorpicker(){this.colorpick=!0}}};const Ae={class:"color-palette-container"},Re={class:"color-palette-icon"},Ee={key:0,class:"icon-palette-regular"},Me={key:1,class:"highlight-container"},Ie={key:0,class:"highlight-icon"},$e=["id"],Te=["id"],Ne={class:"color-container-specific-color"},Be={class:"color-container-specific-color1"},Oe={class:"color-container-specific-color"},Pe={class:"color-container2323"},qe=["value"],Le={key:0,class:"color-container-title"},De={class:"color-container-specific-color2"};xe.render=function(n,s,c,d,m,u){const g=p("hlx-overlay");return e(),i("div",Ae,[o("div",Re,[1==m.fill_color?(e(),i("i",Ee)):t("v-if",!0),!0===c.highlightColor?(e(),i("div",Me,[!0===c.highlightColor?(e(),i("p",Ie,"A")):t("v-if",!0),t(' <div class="higlight-icon-border" v-if="this.highlightColor === true"></div> ')])):t("v-if",!0),o("div",{class:"color-icon-border",style:f({background:m.colorvalue})},null,4)]),o("button",{id:"color-palette-open-icon"+m.unique,"aria-dis":"",class:"color-palette-open-icon",onClick:s[0]||(s[0]=(...e)=>u.colorpalette&&u.colorpalette(...e))},[...s[7]||(s[7]=[o("i",{class:"icon-angle-down-regular"},null,-1)])],8,$e),m.colorcontainer?(e(),l(g,{key:0,show:m.colorcontainer,top:m.containertop,left:m.containerleft,width:100,conditionvalue:150,conditionup:55,onCloseOverlay:n.onClose},{overlay:h(()=>[o("div",{id:"color-container"+m.unique,class:"color-container"},[s[8]||(s[8]=o("p",{class:"color-container-title"},"Theme Colors",-1)),o("div",Ne,[(e(!0),i(a,null,r(m.colordata,(a,t)=>(e(),i("div",{key:t,class:"color-container-specific-color-checkbox-border",onClick:s[1]||(s[1]=(...e)=>u.getcolor&&u.getcolor(...e))},[o("button",{class:"color-container-specific-color-checkbox-border-fill-color",style:f({background:Object.keys(m.colordata[t])[0]})},null,4)]))),128))]),o("button",Be,[(e(!0),i(a,null,r(m.colordata,(t,n)=>(e(),i("div",{key:n,class:"color-container-specific-color1-container",onClick:s[2]||(s[2]=(...e)=>u.getcolor&&u.getcolor(...e))},[(e(!0),i(a,null,r(Object.values(m.colordata[n])[0].length,(a,t)=>(e(),i("div",{key:t,class:"color-container-specific-color-checkbox-border"},[o("button",{class:"color-container-specific-color-checkbox-border-fill-color",style:f({background:Object.values(m.colordata[n])[0][t]})},null,4)]))),128))]))),128))]),s[9]||(s[9]=o("p",{class:"color-container-title"},"Standard Colors",-1)),o("button",Oe,[(e(!0),i(a,null,r(m.standardcolor,(a,t)=>(e(),i("div",{key:t,class:"color-container-specific-color-checkbox-border",onClick:s[3]||(s[3]=(...e)=>u.getcolor&&u.getcolor(...e))},[o("button",{class:"color-container-specific-color-checkbox-border-fill-color",style:f({background:m.standardcolor[t]})},null,4)]))),128))]),o("button",Pe,[o("input",{id:"favcolor",type:"color",name:"favcolor",value:m.recentvalue,class:"favcolor",onChange:s[4]||(s[4]=(...e)=>u.getcolorvalue&&u.getcolorvalue(...e))},null,40,qe),o("p",{class:"color-container-title",onClick:s[5]||(s[5]=(...e)=>u.colorpicker&&u.colorpicker(...e))}," More Colors ")]),!0===m.recent?(e(),i("p",Le," Recent color ")):t("v-if",!0),o("div",De,[(e(!0),i(a,null,r(m.recentcolor,(a,t)=>(e(),i("div",{key:t,class:"color-container-specific-color-checkbox-border",onClick:s[6]||(s[6]=(...e)=>u.getcolor&&u.getcolor(...e))},[o("button",{class:"color-container-specific-color-checkbox-border-fill-color",style:f({background:m.recentcolor[t]})},null,4)]))),128))])],8,Te)]),_:1},8,["show","top","left","onCloseOverlay"])):t("v-if",!0)])},xe.__file="src/components/ColorpaletteComponent.vue";var ze="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var je,Fe={exports:{}};var Ue,Ke,Ge,He,We=(je||(je=1,Ue=Fe,Ke=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],Ge="undefined"!=typeof window,He=Ge&&null!=window.mozInnerScreenX,Ue.exports=function(e,i,a){if(!Ge)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var t=a&&a.debug||!1;if(t){var o=document.querySelector("#input-textarea-caret-position-mirror-div");o&&o.parentNode.removeChild(o)}var n=document.createElement("div");n.id="input-textarea-caret-position-mirror-div",document.body.appendChild(n);var l=n.style,s=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r="INPUT"===e.nodeName;l.whiteSpace="pre-wrap",r||(l.wordWrap="break-word"),l.position="absolute",t||(l.visibility="hidden"),Ke.forEach(function(e){r&&"lineHeight"===e?l.lineHeight=s.height:l[e]=s[e]}),He?e.scrollHeight>parseInt(s.height)&&(l.overflowY="scroll"):l.overflow="hidden",n.textContent=e.value.substring(0,i),r&&(n.textContent=n.textContent.replace(/\s/g," "));var c=document.createElement("span");c.textContent=e.value.substring(i)||".",n.appendChild(c);var d={top:c.offsetTop+parseInt(s.borderTopWidth),left:c.offsetLeft+parseInt(s.borderLeftWidth),height:parseInt(s.lineHeight)};return t?c.style.backgroundColor="#aaa":document.body.removeChild(n),d}),Fe.exports),Je=Ve(We);function Ze(){return Ze=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var a=arguments[i];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},Ze.apply(this,arguments)}var Ye,Xe="undefined"!=typeof window&&navigator&&/Win/i.test(navigator.platform),Qe="undefined"!=typeof window&&navigator&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),ei=g({props:{lineNumbers:{type:Boolean,default:!1},autoStyleLineNumbers:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},modelValue:{type:String,default:""},highlight:{type:Function,required:!0},tabSize:{type:Number,default:2},insertSpaces:{type:Boolean,default:!0},ignoreTabKey:{type:Boolean,default:!1},placeholder:{type:String,default:""}},data:function(){return{capture:!0,history:{stack:[],offset:-1},lineNumbersHeight:"20px",codeData:""}},watch:{modelValue:{immediate:!0,handler:function(e){this.codeData=e||""}},content:{immediate:!0,handler:function(){var e=this;this.lineNumbers&&this.$nextTick(function(){e.setLineNumbersHeight()})}},lineNumbers:function(){var e=this;this.$nextTick(function(){e.styleLineNumbers(),e.setLineNumbersHeight()})}},computed:{isEmpty:function(){return 0===this.codeData.length},content:function(){return this.highlight(this.codeData)+"<br />"},lineNumbersCount:function(){return this.codeData.split(/\r\n|\n/).length}},mounted:function(){this._recordCurrentState(),this.styleLineNumbers()},methods:{setLineNumbersHeight:function(){this.lineNumbersHeight=getComputedStyle(this.$refs.pre).height},styleLineNumbers:function(){if(this.lineNumbers&&this.autoStyleLineNumbers){var e=this.$refs.pre,i=this.$el.querySelector(".prism-editor__line-numbers"),a=window.getComputedStyle(e);this.$nextTick(function(){var t="border-top-left-radius",o="border-bottom-left-radius";if(i){i.style[t]=a[t],i.style[o]=a[o],e.style[t]="0",e.style[o]="0";["background-color","margin-top","padding-top","font-family","font-size","line-height"].forEach(function(e){i.style[e]=a[e]}),i.style["margin-bottom"]="-"+a["padding-top"]}})}},_recordCurrentState:function(){var e=this.$refs.textarea;if(e){var i=e.value,a=e.selectionStart,t=e.selectionEnd;this._recordChange({value:i,selectionStart:a,selectionEnd:t})}},_getLines:function(e,i){return e.substring(0,i).split("\n")},_applyEdits:function(e){var i=this.$refs.textarea,a=this.history.stack[this.history.offset];a&&i&&(this.history.stack[this.history.offset]=Ze({},a,{selectionStart:i.selectionStart,selectionEnd:i.selectionEnd})),this._recordChange(e),this._updateInput(e)},_recordChange:function(e,i){void 0===i&&(i=!1);var a=this.history,t=a.stack,o=a.offset;if(t.length&&o>-1){this.history.stack=t.slice(0,o+1);var n=this.history.stack.length;if(n>100){var l=n-100;this.history.stack=t.slice(l,n),this.history.offset=Math.max(this.history.offset-l,0)}}var s=Date.now();if(i){var r=this.history.stack[this.history.offset];if(r&&s-r.timestamp<3e3){var c,d,m=/[^a-z0-9]([a-z0-9]+)$/i,u=null===(c=this._getLines(r.value,r.selectionStart).pop())||void 0===c?void 0:c.match(m),f=null===(d=this._getLines(e.value,e.selectionStart).pop())||void 0===d?void 0:d.match(m);if(u&&f&&f[1].startsWith(u[1]))return void(this.history.stack[this.history.offset]=Ze({},e,{timestamp:s}))}}this.history.stack.push(Ze({},e,{timestamp:s})),this.history.offset++},_updateInput:function(e){var i=this.$refs.textarea;i&&(i.value=e.value,i.selectionStart=e.selectionStart,i.selectionEnd=e.selectionEnd,this.$emit("update:modelValue",e.value))},handleChange:function(e){var i=e.target,a=i.value,t=i.selectionStart,o=i.selectionEnd;this._recordChange({value:a,selectionStart:t,selectionEnd:o},!0),this.$emit("update:modelValue",a)},_undoEdit:function(){var e=this.history,i=e.stack,a=e.offset,t=i[a-1];t&&(this._updateInput(t),this.history.offset=Math.max(a-1,0))},_redoEdit:function(){var e=this.history,i=e.stack,a=e.offset,t=i[a+1];t&&(this._updateInput(t),this.history.offset=Math.min(a+1,i.length-1))},handleKeyDown:function(e){var i=this.tabSize,a=this.insertSpaces,t=this.ignoreTabKey;if(this.$emit("keydown",e),!e.defaultPrevented){27===e.keyCode&&(e.target.blur(),this.$emit("blur",e));var o=e.target,n=o.value,l=o.selectionStart,s=o.selectionEnd,r=(a?" ":"\t").repeat(i);if(9===e.keyCode&&!t&&this.capture)if(e.preventDefault(),e.shiftKey){var c=this._getLines(n,l),d=c.length-1,m=this._getLines(n,s).length-1,u=n.split("\n").map(function(e,i){return i>=d&&i<=m&&e.startsWith(r)?e.substring(r.length):e}).join("\n");if(n!==u){var f=c[d];this._applyEdits({value:u,selectionStart:f.startsWith(r)?l-r.length:l,selectionEnd:s-(n.length-u.length)})}}else if(l!==s){var p=this._getLines(n,l),h=p.length-1,g=this._getLines(n,s).length-1,y=p[h];this._applyEdits({value:n.split("\n").map(function(e,i){return i>=h&&i<=g?r+e:e}).join("\n"),selectionStart:/\S/.test(y)?l+r.length:l,selectionEnd:s+r.length*(g-h+1)})}else{var b=l+r.length;this._applyEdits({value:n.substring(0,l)+r+n.substring(s),selectionStart:b,selectionEnd:b})}else if(8===e.keyCode){var v=l!==s;if(n.substring(0,l).endsWith(r)&&!v){e.preventDefault();var k=l-r.length;this._applyEdits({value:n.substring(0,l-r.length)+n.substring(s),selectionStart:k,selectionEnd:k})}}else if(13===e.keyCode){if(l===s){var _=this._getLines(n,l).pop(),w=null==_?void 0:_.match(/^\s+/);if(w&&w[0]){e.preventDefault();var S="\n"+w[0],C=l+S.length;this._applyEdits({value:n.substring(0,l)+S+n.substring(s),selectionStart:C,selectionEnd:C})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var x;57===e.keyCode&&e.shiftKey?x=["(",")"]:219===e.keyCode?x=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?x=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(x=["`","`"]),l!==s&&x&&(e.preventDefault(),this._applyEdits({value:n.substring(0,l)+x[0]+n.substring(l,s)+x[1]+n.substring(s),selectionStart:l,selectionEnd:s+2}))}else!(Qe?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)||e.shiftKey||e.altKey?(Qe?e.metaKey&&90===e.keyCode&&e.shiftKey:Xe?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),this._redoEdit()):77!==e.keyCode||!e.ctrlKey||Qe&&!e.shiftKey||(e.preventDefault(),this.capture=!this.capture):(e.preventDefault(),this._undoEdit())}}},render:function(){var e=this,i=y("div",{class:"prism-editor__line-width-calc",style:"height: 0px; visibility: hidden; pointer-events: none;"},"999"),a=y("div",{class:"prism-editor__line-numbers",style:{"min-height":this.lineNumbersHeight},"aria-hidden":"true"},[i,Array.from(Array(this.lineNumbersCount).keys()).map(function(e,i){return y("div",{class:"prism-editor__line-number token comment"},""+ ++i)})]),t=y("textarea",{ref:"textarea",onInput:this.handleChange,onKeydown:this.handleKeyDown,onClick:function(i){e.$emit("click",i)},onKeyup:function(i){e.$emit("keyup",i)},onFocus:function(i){e.$emit("focus",i)},onBlur:function(i){e.$emit("blur",i)},class:{"prism-editor__textarea":!0,"prism-editor__textarea--empty":this.isEmpty},spellCheck:"false",autocapitalize:"off",autocomplete:"off",autocorrect:"off","data-gramm":"false",placeholder:this.placeholder,"data-testid":"textarea",readonly:this.readonly,value:this.codeData}),o=y("pre",{ref:"pre",class:"prism-editor__editor","data-testid":"preview",innerHTML:this.content}),n=y("div",{class:"prism-editor__container"},[t,o]);return y("div",{class:"prism-editor-wrapper"},[this.lineNumbers&&a,n])}}),ii={exports:{}},ai={},ti={exports:{}},oi={},ni={};function li(){if(Ye)return ni;function e(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function i(e,i){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),i=i||"",e.indent_level>0&&(i=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}function a(a,t){this.__indent_cache=new i(a,t),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return Ye=1,e.prototype.clone_empty=function(){var i=new e(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},e.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},e.prototype.has_match=function(e){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(e))return!0;return!1},e.prototype.set_indent=function(e,i){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},e.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},e.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},e.prototype.is_empty=function(){return 0===this.__items.length},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(e){this.__items.push(e);var i=e.lastIndexOf("\n");-1!==i?this.__character_count=e.length-i:this.__character_count+=e.length},e.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},e.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},i.prototype.get_indent_size=function(e,i){var a=this.__base_string_length;return i=i||0,e<0&&(a=0),a+=e*this.__indent_size,a+=i},i.prototype.get_indent_string=function(e,i){var a=this.__base_string;return i=i||0,e<0&&(e=0,a=""),i+=e*this.__indent_size,this.__ensure_cache(i),a+=this.__cache[i]},i.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},i.prototype.__add_column=function(){var e=this.__cache.length,i=0,a="";this.__indent_size&&e>=this.__indent_size&&(e-=(i=Math.floor(e/this.__indent_size))*this.__indent_size,a=new Array(i+1).join(this.__indent_string)),e&&(a+=new Array(e+1).join(" ")),this.__cache.push(a)},a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(e,i){return this.__indent_cache.get_indent_string(e,i)},a.prototype.get_indent_size=function(e,i){return this.__indent_cache.get_indent_size(e,i)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(e){this.trim(!0);var i=this.current_line.pop();i&&("\n"===i[i.length-1]&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join("\n");return"\n"!==e&&(a=a.replace(/[\n]/g,e)),a},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(e,i){return e=e||0,i=i||0,this.next_line.set_indent(e,i),this.__lines.length>1?(this.current_line.set_indent(e,i),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(e){for(var i=0;i<e.newlines;i++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(e.whitespace_before),this.current_line.push(e.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(e){this.__add_space_before_token(),this.current_line.push(e),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},a.prototype.remove_indent=function(e){for(var i=this.__lines.length;e<i;)this.__lines[e]._remove_indent(),e++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(e){for(e=void 0!==e&&e,this.current_line.trim();e&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(i,a){for(var t=this.__lines.length-2;t>=0;){var o=this.__lines[t];if(o.is_empty())break;if(0!==o.item(0).indexOf(i)&&o.item(-1)!==a){this.__lines.splice(t+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},ni.Output=a,ni}var si,ri={};function ci(){if(si)return ri;return si=1,ri.Token=function(e,i,a,t){this.type=e,this.text=i,this.comments_before=null,this.newlines=a||0,this.whitespace_before=t||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null},ri}var di,mi={};function ui(){return di||(di=1,n="(?:"+(o="\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}")+"|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(a="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\